Redis

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.

Question 1
Interview Intermediate
Question

RDB vs AOF — what is the difference?

Answer:

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.

Question 2
Interview Intermediate
Question

appendfsync always vs everysec vs no?

Answer:

always safest slowest, everysec usual (lose about a second), no fastest. I pick everysec for most app Redis. RPS and disk type matter.

Question 3
Interview Beginner
Question

Why rewrite AOF?

Answer:

It grows with every write. Rewrite compact equivalent. Watch disk. Without rewrite the disk fills and Redis stops. Maintenance like vacuum.

Question 4
Interview Advanced
Question

Only one for a session store?

Answer:

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.

Question 5
Interview Intermediate
Question

Does a replica replace primary persistence?

Answer:

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