Code
redis
# redis.conf - RDB snapshots
save 900 1 # 1 change in 900s
save 300 10 # 10 changes in 300s
save 60 10000
dbfilename dump.rdb
dir /var/lib/redis
# AOF (Append Only File)
appendonly yes
appendfilename "appendonly.aof"
appendfsync everysec # always | everysec | no
# Manual commands
BGSAVE # async RDB snapshot
BGREWRITEAOF # compact AOF
LASTSAVE # timestamp of last save
DEBUG OBJECT key # internal info
# Mixing RDB + AOF gives best durability + recovery speed
# aof-use-rdb-preamble yes (RDB prefix in AOF)