This week in caching: Redis RDB vs AOF when it's more than a cache
Matters the moment Redis holds sessions or rate-limit counters you can't lose:
— RDB snapshots: point-in-time dumps, tiny files, fast restart, low overhead. You can lose the last few minutes of writes on a crash — totally fine for a pure cache.
— AOF: logs every write, near-zero data loss with fsync everysec, but bigger files and slower restarts as it replays the log.
— The pragmatic answer: pure ephemeral cache → RDB only (or persistence off entirely, more RAM for data). Redis doubling as a session/queue store → AOF, or both for belt-and-suspenders.
Don't pay AOF's write cost for data you'd happily rebuild from the DB — that's the most common over-engineering here.
Bookmark: the Redis persistence docs — the RDB-vs-AOF tradeoff table is genuinely well written.
Cache Catch
@CacheCatch
This week in caching: Redis RDB vs AOF when it's more than a cache
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.