clickfreak opened a new issue, #2915: URL: https://github.com/apache/kvrocks/issues/2915
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/kvrocks/issues) and found no similar issues. ### Motivation Applications connected to the KVRocks read-only replica use their own cache to reduce response latency and minimize direct requests to KVRocks. However, the application must react to key changes in order to provide up-to-date responses. We don’t use TTLs for keys and don’t expect key expiration events — this is also difficult to implement due to the nature of the KVRocks underlying storage (rocksdb). As minimum we need to react on SET and DEL commands, apps itself can control the subscription using PSUBSCRIBE and PUNSUBSCRIBE commands, it will allow to replace Redis/Valkey with minimal effort. KVRocks is excellent for distributing data across the fleet without wasting RAM, and it’s a very strong candidate to replace our current Redis storage. Keyspace events are the last missing piece preventing us from fully switching from Redis/Valkey to KVRocks. ### Solution From what I understand, KVRocks uses a WAL internally to replicate changes. This means that when the WAL is applied on replicas, it should be possible to detect key changes and emit events to applications with subscriptions by pattern (PSUBSCRIBE/PUNSUBSCRIBE). ### Are you willing to submit a PR? - [ ] I'm willing to submit a PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
