I want a similar data Structure as a Redis list which also have maximum limit on length as like Redis Stream

52 Views Asked by At

I want a similar data Structure as a Redis list which also have maximum limit on length as like Redis Stream. My usecase is to consume less space less operation(I can use stream but it is not good for me because of data I am handling and Ltrim on list will increase no of operations) if exceeding the limit new data should be stored and previous one should be evicted.

I tried using Redis Stream but then I have to perform this operation to read the data from Stream

let signal = await this._redis.xrange(key + '_', '-', '+');
console.log(signal.map((data) =\> data\[1\]\[1\]));
return signal.map((data) =\> data\[1\]\[1\]);

this is also costly as compare to list

0

There are 0 best solutions below