Persistence Options in Redis

From the Redis cheat sheet ยท Persistence & Backup ยท verified Jul 2026

Persistence Options

RDB snapshots and AOF logging

bash
# RDB (snapshots)
SAVE                    # Synchronous save
BGSAVE                  # Background save
LASTSAVE               # Last save timestamp

# AOF (Append Only File)
CONFIG SET appendonly yes
BGREWRITEAOF           # Rewrite AOF file

# Configure in redis.conf
save 900 1             # Save after 900s if 1 key changed
appendonly yes         # Enable AOF
๐Ÿ’พ RDB for periodic snapshots
๐Ÿ“ AOF for write durability
๐Ÿ”„ Hybrid mode combines both benefits
โšก Choose based on durability vs performance needs

Continue with Redis

Save the full cheat sheet or work through every related task.

Back to the full Redis cheat sheet