</>shravan.dev
← Back to all articles

Redis Persistence: RDB vs AOF

How Redis survives restarts — a practical look at RDB snapshots and AOF append-only logs.

Jun 15, 2026 · 1 min read · Databases

Redis Persistence

Redis is in-memory, but it can still survive restarts. Two mechanisms handle that: RDB and AOF.

RDB (Redis Database)

RDB takes point-in-time snapshots of your dataset.

save 900 1
save 300 10
save 60 10000

Pros: compact files, fast restarts, good for backups. Cons: you can lose data since the last snapshot.

AOF (Append Only File)

AOF logs every write command and replays them on startup.

appendonly yes
appendfsync everysec

Pros: better durability, easier to reason about data loss windows. Cons: larger files, potentially slower restarts on huge datasets.

What I'd pick

For a cache: RDB alone is often enough. For a primary data store: AOF (or both) is the safer default.