Durability & Persistence

Redis is in-memory, but it's not ephemeral. Discover how Redis ensures data survives crashes through RDB snapshots and AOF logs.

RDB Snapshot Timeline
Click 'Snapshot Now' to trigger a background save (BGSAVE)

RDB Characteristics

  • • Periodic point-in-time snapshots
  • • Extremely compact (binary format)
  • • Faster restarts for large datasets
  • • Potential data loss between snapshots

AOF Characteristics

  • • Append-only log of every write
  • • Much more durable (configurable fsync)
  • • File can grow large (needs Rewrite)
  • • Slower to load but more granular
AOF Rewrite (BGREWRITEAOF)

As more writes occur, the AOF file grows. Redis solves this by "rewriting" the AOF in the background to its minimal representation.

# Original Log

SET x 1

SET x 2

SET x 3

# After Rewrite

SET x 3

Reconstruction of current state, not log modification.

Copy-on-Write (CoW)

Redis uses the fork() system call to create a child process for non-blocking persistence.

The child process has a "copy" of the parent's memory. Memory is only actually copied if it's modified, making forks extremely efficient.

Non-blocking Persistence

Parent continues serving clients while child saves data.

Choosing a Strategy

Balance between performance and durability.

High Performance
RDB Only
Best for caches where occasional data loss is acceptable. Nearly zero overhead.
Maximum Safety
AOF Only
Strict durability. can be slower due to FSYNC operations on every write.
Recommended
Hybrid (Both)
Uses RDB for snapshots and AOF for incremental changes. The gold standard.

© 2026 Redis Visualizer. Built for educational purposes.