Interview practice question
Keeping a cache in sync with database updates
Backend Engineering · Relational Databases · Experienced
Your app updates the database and then deletes a Redis key. Sometimes a stale value ends up back in the cache. How do you fix it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Race: concurrent read refills stale value.
- Delete after commit, not before.
- Short TTL as safety net.
- Versioned cache entries.
- CDC-driven invalidation.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.