tackling stale cache issue
- if we are using key expiration functionality, then
- cache could be stale if the value is updated more frequently than the expiration setting (e.g, keys are updated 5 times during the expiration window)
- expiration time must be set randomly, else we could be hit with a cache storm/stampede (multiple keys are expired at the same time -> multiple connections to fetch new data at the same time)
Why not write-behind-cache?
- Valkey/Redis is not exactly ACID compliant; using it as the primary data source runs the risk of losing transactions
https://debezium.io/documentation/reference/stable/operations/debezium-server.html