Hi,
Think something like this:
I have a bunch of worker tasks(worker bees) communicating with redis cluster, each work bees has their own redis client.
The data structure which they work on is something like user sessions. There is no session pinning. When a request arrives, any worker can pick up, retrieve the user session, work and then write back.
But, I have a timer requirement. I want take some action on the user session if they are not active for some duration (for example days). I have a limitation of not maintaining the timer at the application level because the user request can be processed by any worker.
So, I am thinking if this can be done at the database level. There could be a timer set for a particular entry and when the timer expires it should notify. In the mean time, if there is any request for that user session comes then the worker can reset and write back the timer with a different value.
Please advice.
Thanks, Santos