Interview Prep/Real-World Interview/Data loss and corruption

Redis restarted after a node reboot and every shopping cart and queued job is gone.

BeginnerTroubleshootingData loss and corruption
Answer

Likely causes → Redis was used as a primary data store with persistence turned off (no RDB snapshots, no AOF), so everything lived only in memory.

Diagnose →

redis-cli CONFIG GET save
redis-cli CONFIG GET appendonly
redis-cli INFO persistence | grep -E 'rdb_last_save_time|aof_enabled'

Fix → The lost data can't be recovered from Redis. Rebuild what you can from the source of truth (orders in the DB, events in a log). Turn on persistence now.

Prevent → Decide explicitly whether data in Redis is a cache (fine to lose) or state (must persist). For state, enable AOF (appendonly yes, appendfsync everysec) plus RDB snapshots, run replicas, or move durable data such as job queues to a system built for it (a database, SQS, Kafka).

All Real-World Interview questions Roadmap: Interview readiness

More on Data loss and corruption