Interview practice question
Cache and database diverge after failures
Backend Engineering · NoSQL and Redis · Experienced
Occasionally your Redis cache shows data that never matched the database because the database write failed after the cache was updated. How do you fix the write path?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Never update cache before DB commit.
- Write DB first, then invalidate.
- Delete rather than set.
- Outbox/CDC-driven invalidation.
- TTL safety net.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.