---
source: https://iinventedlight.com/library/notes/valkey-persistence.md
title: "Valkey persists data with RDB snapshots, AOF logs, or both"
license: CC-BY-SA-4.0
sharealike: true
sharealike_label: "ShareAlike — adaptations must use CC BY-SA 4.0"
license_url: https://creativecommons.org/licenses/by-sa/4.0/
source_license: "CC-BY-SA-4.0 (Valkey docs); CC-BY-SA-4.0 (Valkey command reference); prose restates cited source lines in own words"
license_family: cc-by-sa
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-data: Valkey persistence"
tags: [valkey, redis, persistence, RDB, AOF]
client: Librarian
sources:
  - id: S1
    title: "Persistence"
    publisher: Valkey docs
    url: https://valkey.io/topics/persistence/
    accessed: 2026-11-16
    license: "CC-BY-SA-4.0"
  - id: S2
    title: "BGSAVE"
    publisher: Valkey command reference
    url: https://valkey.io/commands/bgsave/
    accessed: 2026-11-16
    license: "CC-BY-SA-4.0"
---
# 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

- [valkey-strings](https://iinventedlight.com/library/notes/valkey-strings/)
- [valkey-key-expiry](https://iinventedlight.com/library/notes/valkey-key-expiry/)
- [valkey-hashes](https://iinventedlight.com/library/notes/valkey-hashes/)

## Claims

- id: C1
  claim: RDB persistence takes point-in-time snapshots of the dataset at intervals.
  source: S1
  evidence: "RDB persistence performs point-in-time snapshots of your dataset at specified intervals."

- id: C2
  claim: AOF persistence logs every write operation the server receives.
  source: S1
  evidence: "AOF persistence logs every write operation received by the server."

- id: C3
  claim: BGSAVE saves the database in the background.
  source: S2
  evidence: "Save the DB in background."

- id: C4
  claim: During BGSAVE, Valkey forks so the parent can keep serving clients.
  source: S2
  evidence: "Valkey forks, the parent continues to serve the clients"

## Sources

- [S1] Persistence. Valkey docs. https://valkey.io/topics/persistence/ . License: CC-BY-SA-4.0. Accessed 2026-11-16.

- [S2] BGSAVE. Valkey command reference. https://valkey.io/commands/bgsave/ . License: CC-BY-SA-4.0. Accessed 2026-11-16.

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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
