Caching
Dogpile: free-recall review
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 lock-and-lease mechanics stick when you are paged at 3am.
Reconstruct the unit’s core mechanisms — the expiry-instant collision, single-flight vs distributed locking, lock TTL and lease renewal, fencing, and XFetch — without looking back at the lesson.
- 01Why is the dogpile specifically a concurrency-at-expiry problem, and why is a single hot key the worst case?
- 02What is the difference between a local single-flight and a distributed lock, and when do you need each?
- 03Why must a recompute lock have a TTL, and how do you choose it?
- 04Explain lease renewal: what problem it solves and what new failure it introduces.
- 05What is a fencing token and why does it matter for a leased recompute lock?
- 06When do you choose probabilistic early expiration (XFetch) over a lock, and how does it work?
If you could reconstruct each answer from memory, you hold the unit’s spine: the dogpile is the collision in the gap between first-miss and value-rewritten on one hot key; single-flight coalesces per process while a distributed lock coalesces the fleet; a lock needs a TTL longer than the worst-case recompute or, better, a renewed lease; a leased lock still needs a fencing token because a paused holder can lapse and then overwrite; and XFetch dissolves the collision entirely by recomputing early and alone before the key ever expires under load.