← All notes

Valkey persists data with RDB snapshots, AOF logs, or both

Answer: Persistence is the writing of data to durable storage. Valkey provides RDB snapshots, AOF logs, no persistence, or RDB and AOF together. RDB performs point-in-time snapshots of your dataset at specified intervals. AOF logs every write operation received by the server and replays those operations at startup.

RDB snapshots

By default Valkey saves snapshots of the dataset also on disk in a binary file called dump.rdb. You can configure save points, or call SAVE or BGSAVE yourself. For example, save 60 1000 dumps the dataset every 60 seconds if at least 1000 keys changed. This strategy is known as snapshotting. To disable RDB, set save to the empty string. On BGSAVE, Valkey forks, the parent continues to serve the clients, and the child writes the DB on disk. RDB files are compact and are perfect for backups. You should be prepared to lose the latest minutes of data if a snapshot is not new.

AOF logs

Turn on AOF with appendonly yes. Every command that changes the dataset is appended to the AOF, and restarting Valkey replays the file to rebuild the state. You can set how often Valkey calls fsync: always, everysec, or no. The default policy of fsync every second keeps write performance high, with up to one second of writes at risk. AOF files are usually bigger than equivalent RDB files. Valkey can rewrite the AOF in the background, including when you issue BGREWRITEAOF.

See also

Claims

Sources

License: this note is CC BY SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/). Summary by iinventedlight (AI-assisted). Sources: Valkey docs, Persistence, CC-BY-SA-4.0 (https://raw.githubusercontent.com/valkey-io/valkey-doc/main/LICENSE); Valkey command reference, BGSAVE, CC-BY-SA-4.0 (https://raw.githubusercontent.com/valkey-io/valkey-doc/main/LICENSE). Text was condensed and changed from the originals.

License: CC-BY-SA-4.0 · Summary by iinventedlight (AI-assisted). Sources: Valkey docs, Persistence, CC-BY-SA-4.0 (https://raw.githubusercontent.com/valkey-io/valkey-doc/main/LICENSE); Valkey command reference, BGSAVE, CC-BY-SA-4.0 (https://raw.githubusercontent.com/valkey-io/valkey-doc/main/LICENSE). · ShareAlike — adaptations must use CC BY-SA 4.0

Cite this

Permanent ID: iil:note:vwzznthx

iinventedlight. 2026. "Valkey persists data with RDB snapshots, AOF logs, or both." iinventedlight Library, iil:note:vwzznthx, version of 2026-11-16. https://iinventedlight.com/library/notes/valkey-persistence/. License: CC-BY-SA-4.0.

@misc{iil_note_vwzznthx,
  author = {{iinventedlight}},
  title = {{Valkey persists data with RDB snapshots, AOF logs, or both}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-16},
  url = {https://iinventedlight.com/library/notes/valkey-persistence/},
  note = {Permanent ID iil:note:vwzznthx. License: CC-BY-SA-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/valkey-persistence.md.