dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Support keyspace notifications

Open Cylkal opened this issue 1 year ago • 3 comments

Redis support keyspace notifications by command CONFIG SET notify-keyspace-events xE, but dragonfly does not support it:

CONFIG SET notify-keyspace-events xE
(error) ERR CONFIG SET failed (possibly related to argument 'notify-keyspace-events').

I'd like to subscribe to timeout key events. Is there any solution?

Cylkal avatar Aug 07 '23 03:08 Cylkal

Dragonfly does not support key events. Specifically, timeout events is not designed well in Redis and does not guarantee accurate events for all the keys. Can you please describe your use-case for this ?

romange avatar Aug 07 '23 04:08 romange

@romange My scenario is to monitor which key expires in real time, which was previously achieved by subscribing to redis's key expiration event. In my system, key expiration means that the tasks corresponding to this key may not be handled in a timely manner, and a mechanism is needed to monitor these tasks that are not handled in time. It is true that the redis key event is not a reliable method, but it does not need to implement too many functions alone, so it is convenient.

Cylkal avatar Aug 07 '23 06:08 Cylkal

@romange My scenario is to monitor which key expires in real time, which was previously achieved by subscribing to redis's key expiration event. In my system, key expiration means that the tasks corresponding to this key may not be handled in a timely manner, and a mechanism is needed to monitor these tasks that are not handled in time. It is true that the redis key event is not a reliable method, but it does not need to implement too many functions alone, so it is convenient.

Are there other methods besides the one you mentioned? Because I'm using the same thing in my project

glad2os avatar Sep 08 '23 18:09 glad2os

We cannot convert redis to dragonflydb in some scenarios due to this limitation. Happy to answer any other questions about this use case. But it does seem like a necessary feature of redis to support.

ostlerc avatar Aug 21 '24 22:08 ostlerc