I need to place some data into redis so that each element has a sliding expiration (say 60 seconds each).

I also need to be able to get a list of all elements that are currently in Redis.

Initially i just placed all elements in one-by-one, but unfortunately when it came to loading them, i realised that Keys() and SCAN() have a huge overhead, both in terms of clustering (e.g. keys only works on a server in the node) and in terms of real time performance on databases of a few billion records.

The next thing i looked at are sets, the problem being that i have to iterate the sets myself, and expire items myself, too.

What's the best practice for something like this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.