0

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

2
  • Wrap lpush and ltrim into a Lua script to reduce RTT. Commented Jan 11, 2023 at 2:00
  • can you please suggest any example for the help? Commented Jan 11, 2023 at 9:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.