awesome-everything RU
↑ Back to the climb

Caching

Cache invalidation: free-recall review

Crux Free-recall prompts across cache invalidation. Answer each from memory first — the set-after-delete race, TTL jitter, dual-write, and the write strategies — then reveal the model answer and compare.
Your altitude — climbing toward senior
ZeroJuniorMiddleSenior
You are at senior altitude — in orbit
◷ 14 min

Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the consistency model stick when an incident hits at 3am.

Goal

Reconstruct the unit’s spine — why invalidation is a staleness choice, the set-after-delete race and its three fixes, why a TTL stays even with active purge, and what each write strategy buys — without looking back at the lesson.

Recall before you leave
  1. 01
    Why is cache invalidation framed as 'choosing which staleness you ship' rather than a problem you can fully solve?
  2. 02
    Walk through the set-after-delete race step by step, and name the three ways to close it in rising order of cost.
  3. 03
    Why keep a TTL even when you actively invalidate on every write, and what is the dual-write problem?
  4. 04
    What is the thundering herd from synchronized TTL expiry, and how do jitter and probabilistic early refresh defuse it?
  5. 05
    Why delete the cache key on write rather than update it with the new value?
  6. 06
    Contrast write-through, write-behind, and write-around: what each buys and breaks.
Recap

If you reconstructed each answer from memory, you hold the unit’s spine: invalidation is choosing which staleness to ship because cache and DB share no transaction; the set-after-delete race is the production trap, closed by double-delete, leases, or write-through; a TTL stays even with active purge as the backstop for the dual-write that silently fails; synchronized expiry stampedes the origin, defused by jitter and probabilistic early refresh; delete beats update because it is idempotent and order-independent; and the write strategy — through, behind, around — is a read-your-writes-vs-durability decision.

Continue the climb ↑Cache invalidation: code and snippet reading
shortcuts expand
search
K
prev piece
k
next piece
j
cycle tier
t
this menu
?
sources3
expand
  1. 01
  2. 02
  3. 03

Trademarks belong to their respective owners. Editorial reference only.