RDB, AOF, and what a crash actually costs

Redis Course · lesson 11 of 19 · 5 min read

Snapshots lose everything since the last one; the append log loses at most a second - and both cost you something.

Open this lesson in the learning hub

Key points

  • RDB writes a point-in-time snapshot by forking a child process, so the parent keeps serving while it is written.
  • The Redis 7 default save points are save 3600 1, save 300 100 and save 60 10000 - the last snapshot may be an hour old.
  • AOF appends every write command to a log; appendonly ships as no, so it is opt-in.
  • appendfsync defaults to everysec, so an unexpected shutdown loses up to one second of writes.
  • appendfsync always fsyncs before replying, which is durable and dramatically slower on real disks.
  • Redis 7.0 split the AOF into a base file plus incremental files inside the appenddirname directory.

RDB gives fast recovery, AOF with everysec caps the loss at a second, and most durable setups run both.

This is a reading copy. The full lesson — with the visual explainer, the interactive lab and a Run button for the code — lives in the Redis Course course, and every lesson in it is listed on the Redis Course contents page.