The short answer
RDB takes point-in-time snapshots, so an unexpected stop loses everything since the last snapshot — usually minutes. AOF logs every write; with the default fsync-every-second policy you lose about a second at most. The Redis documentation recommends using both: AOF for durability, RDB for backups and faster restarts.
Redis is often treated as a cache that cannot lose anything important. It is a datastore with configurable durability, and the configuration decides exactly how much data disappears when the process stops without a clean shutdown.
RDB: point-in-time snapshots
RDB persistence takes point-in-time snapshots of the dataset at configured intervals [1]. The snapshots are compact single files, which makes them good for backups and disaster recovery, and they allow faster restarts with large datasets than AOF [1].
The cost is the gap between snapshots. The documentation is direct about it: if you snapshot every five minutes or more, as is typical, you should be prepared to lose the latest minutes of data when Redis stops without a correct shutdown [1]. Snapshots also rely on fork(), which on a very large dataset with modest CPU can stop Redis serving clients for milliseconds, or even a second [1].
AOF: a log of every write
AOF persistence logs every write operation and replays the log at startup to rebuild the dataset [1]. How much it can lose depends on the fsync policy [1]:
- `appendfsync always` — fsync on every write. Very slow, very safe.
- `appendfsync everysec` — the default. Fast, and you may lose one second of data in a disaster.
- `appendfsync no` — flushing is left to the operating system. Fastest and least safe; on Linux typically every 30 seconds, depending on kernel tuning.
AOF files are usually larger than the equivalent RDB file, and depending on the fsync policy AOF can be slower [1].
Using both
The documentation recommends both if you want data safety comparable to PostgreSQL, and discourages AOF alone, because periodic RDB snapshots are valuable for backups, faster restarts and protection against bugs in the AOF engine [1]. When both are enabled, Redis rebuilds from the AOF on restart, because it is the most complete [1].
The wider point
An engineer worth trusting with Redis in production can say, for their own configuration, how much data a power cut costs. That number — minutes, one second, or effectively nothing — is the whole persistence conversation, and it is the first thing worth asking.
Sources
- [1] Redis, Redis persistence. Retrieved 4 October 2026.Primary source
Related questions
What is the difference between RDB and AOF in Redis?
RDB takes point-in-time snapshots of the dataset at intervals. AOF logs every write operation and replays it at startup. RDB is compact and restarts faster; AOF loses far less data when the server stops unexpectedly.
How much data can Redis lose with AOF?
With the default appendfsync everysec policy, you may lose about one second of data in a disaster. appendfsync always loses effectively nothing but is very slow; appendfsync no leaves flushing to the operating system.