Lesson 16 / 20

RDB Snapshots vs AOF Logs

Compare RDB snapshots and AOF logs to decide how Redis survives restarts and how much data you can afford to lose.

RDB: point-in-time snapshots

RDB periodically dumps the whole dataset to a compact binary file on disk. Fast to restore, but any writes since the last snapshot are lost on a crash.

AOF: append-only log

AOF logs every write command as it happens. It can be replayed to rebuild state exactly, losing at most a second of writes — safer, but the log grows larger and replay is slower.

Use both together

Most production setups enable both: RDB for fast full backups, AOF for minimal data loss between them.