Interview › Databases & Caching
What are the durability trade-offs between RDB snapshots and AOF?
Databases & Caching · Advanced level
Answer
RDB has lower overhead and faster compact backups but can lose changes after the last snapshot. AOF can reduce loss depending on fsync policy, but increases disk usage, write cost, and rewrite complexity.
Technical explanation
RDB has lower overhead but loses changes since the last snapshot.
AOF with everysec can limit loss but adds disk usage and rewrite overhead.
Neither protects against logical deletes by itself; backups and restore tests are still needed.
Hands-on example
Decision example:
Rate-limit counters: RDB or no persistence may be acceptable.
Shopping cart stored only in Redis: use replication, backups, and stronger persistence, or move source of truth to RDS.
Document the RPO and prove it with a crash test.
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?