RDB vs AOF Interview Questions
RDB vs AOF — what is the difference? — spoken sample answer for Indian interviews.
- 5Questions with answers
- 3Difficulty levels
Questions (5)
Browse beginner, intermediate, and advanced questions with answers — hide them when you want to self-test.
RDB vs AOF — what is the difference?
RDB is a compact point-in-time dump. Restarts can be fast. I lose everything since the last snapshot. The fork during save can pause a busy instance. AOF logs each write. More durable, larger files, needs rewrite. fsync every second is the usual production setting. Replay on a huge AOF can be slow. If the data can be rebuilt, I am fine with RDB only or even no persistence. If losing writes matters, I want AOF. Redis 7 often combines them. That is the comparison I would put on the whiteboard.
appendfsync always vs everysec vs no?
always safest slowest, everysec usual (lose about a second), no fastest. I pick everysec for most app Redis. RPS and disk type matter.
Why rewrite AOF?
It grows with every write. Rewrite compact equivalent. Watch disk. Without rewrite the disk fills and Redis stops. Maintenance like vacuum.
Only one for a session store?
AOF everysec, maybe plus RDB. Sessions tolerate a second better than a 15-minute RDB gap. I state RPO. If Postgres also has sessions I might skip persist.
Does a replica replace primary persistence?
No. Replication is async by default. Replica is HA, not a backup. I still persist on the primary and take backups. People confuse HA and backup.
Practice with AI mock interviews
Run Redis mock interviews with AI follow-ups, instant feedback, and analytics on AiLx.
Free to start · No credit card required