Using redis pub-sub for key expiry

1.5k views Asked by At

I have a requirement where i am pushing my keys to redis with some expiration time. Also have a subscriber for listening key expiration events and then have a callback to my other system which can perform some business rules on it. Is it a good design to have faith in redis pub-sub for this usecase? Average TTL for keys will be in range ~15 minutes.

Using other design will make me having a scheduler/cron(every minute) or some polling system.

1

There are 1 answers

4
Alok Singhal On

Yes, I have been using Redis pub/sub for exactly the same use case in production and has been working quite well for me without any issues.