Redis › Persistence (RDB/AOF)
How would you design a persistence strategy that combines both RDB and AOF to get the benefits of both approaches?
AdvancedAnswer
You would enable both RDB snapshots for fast, compact full backups useful for quick restores and off site backup storage, and AOF for stronger durability during normal operation, configuring Redis to prefer loading from AOF on restart since it typically has less potential data loss, while still keeping RDB snapshots available as an additional safety net and for easier data portability.
CONFIG SET save '900 1'
CONFIG SET appendonly yes
CONFIG SET appendfsync everysecReal-world example A company running a critical Redis instance enables both RDB and AOF together, getting fast periodic snapshots for easy backup and disaster recovery purposes while also benefiting from AOF's stronger protection against data loss during normal operation.