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.
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
- What is Amazon RDS, and what does it manage for you versus self-managed databases?
- What database engines does RDS support?
- What is the difference between RDS and Aurora?
- What is Multi-AZ in RDS, and how does automatic failover work?
- How long does an RDS Multi-AZ failover typically take, and what triggers it?
- What is the difference between Multi-AZ and a read replica?
- When would you use a read replica, and can it become a standalone database?
- Can a read replica be in a different region, and why would you do that?