How does Redis persistence work with RDB and AOF?
Assesses fundamental understanding of Redis conventions, runtime behavior, and memory/performance considerations.
Hiring managers look for precision, avoidance of ambiguous jargon, and ability to explain trade-offs under real production conditions.
Redis offers two persistence mechanisms.
RDB takes point-in-time snapshots at configured intervals, for example save 900 1 snapshots after 900 seconds if at least one key changed. RDB files are compact and fast to load, which is good for backups and restarts, but a crash loses writes since the last snapshot.
AOF appends every write command to a log. With appendfsync everysec Redis fsyncs once per second, a good balance; always is slowest but safest; no lets the OS decide. AOF grows over time and is compacted by rewrite, and you can enable AOF and RDB together.
On restart Redis prefers AOF because it is usually more complete. For pure caches you may disable persistence entirely and rely on the source of truth. Always test the restore path, not just the backup.
Candidate Response Strategy & Interview Tips
- Start with a concise one-sentence summary: Deliver a direct, confident answer first before expanding into nuances.
- Demonstrate real-world trade-offs: Discuss where this approach excels and when you would avoid it in production systems.
- Discuss complexity & edge cases: Proactively explain time/space complexity or boundary conditions (null values, scale limits).
- Prepare for interviewer follow-ups: Technical hiring panels frequently probe deeper into concurrency, backward compatibility, or alternative libraries.