Interview Databases & Caching

What is the difference between Redis persistence options RDB and AOF?

Databases & Caching · Advanced level

Answer

RDB creates point-in-time snapshot files, while AOF appends write commands to a log for replay. RDB is compact and simple but can lose recent writes; AOF improves durability at the cost of disk and write overhead.

Technical explanation

RDB snapshots are compact point-in-time files and are simple to restore.

AOF logs write commands and can reduce data loss depending on fsync policy.

For a pure cache, persistence may be less important; for authoritative Redis data, persistence and backup testing are mandatory.

Hands-on example

Self-managed example:

save 900 1

save 300 10

appendonly yes

appendfsync everysec

Test by writing known keys, forcing restart in staging, and verifying which keys survive.

Preparing for an interview?

Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.

More Databases & Caching interview questions

← All Databases & Caching questions