Introduction
Redis persistence saves your data so it is not lost when the server restarts or crashes.
Redis persistence saves your data so it is not lost when the server restarts or crashes.
RDB (snapshotting): Redis saves data to a dump file at intervals. AOF (Append Only File): Redis logs every write command to a file.
RDB creates snapshots of your data at set times.
AOF records every change, so it can replay commands to restore data.
save 900 1 save 300 10 save 60 10000
appendonly yes appendfsync everysec
This shows checking current RDB save settings, checking if AOF is on, then turning AOF on.
127.0.0.1:6379> CONFIG GET save 1) "save" 2) "900 1 300 10 60 10000" 127.0.0.1:6379> CONFIG GET appendonly 1) "appendonly" 2) "no" 127.0.0.1:6379> CONFIG SET appendonly yes OK 127.0.0.1:6379> CONFIG GET appendonly 1) "appendonly" 2) "yes"
RDB is faster for backups but may lose recent changes if Redis crashes.
AOF is safer but can be slower and the file grows over time.
You can use both together for better safety and faster recovery.
Redis persistence keeps your data safe across restarts.
RDB saves snapshots at intervals, good for fast backups.
AOF logs every change, good for minimal data loss.
Pass the test and this pattern moves unknown