What if your data vanished just because you waited too long to save it?
Why Combined RDB + AOF in Redis? - Purpose & Use Cases
Imagine you run a busy store and keep track of sales on paper. Every hour, you copy all sales into a big book. But if the store closes suddenly, you lose all sales since the last copy.
Copying all sales manually every hour is slow and misses recent sales if a sudden event happens. Also, writing every sale on paper takes time and can cause mistakes or lost data.
Combined RDB + AOF in Redis saves a full snapshot occasionally (RDB) and logs every change (AOF). This way, you get fast recovery from snapshots and no lost data from recent changes.
save_every_hour() log_changes_manually()
redis.conf: save snapshots + appendonly yes
You can recover your data quickly and safely without losing recent updates, even if the system crashes unexpectedly.
An online game saves player scores every few minutes (RDB) and records every move instantly (AOF), so no progress is lost if the server restarts.
Manual backups miss recent changes and are slow.
RDB snapshots save full data fast but can lose recent updates.
AOF logs every change to prevent data loss.