Reference · Caching

Caching — Cheat Sheet

Pairs with Lesson 3: Cache Stampede.

Glossary

TermMeaning
Cache-asideApp checks cache; on miss, reads source of truth, writes result to cache, returns it. Most common pattern.
Cache stampede / thundering herdMany concurrent requests miss the same expired key at once, all hit the backing store simultaneously.
Single-flightCoordination so only one in-flight request computes a given key's value at a time; others wait or get a fallback.
TTL (time to live)How long a cached value is considered fresh before expiry.
JitterRandomized offset added to a timing decision (e.g. expiry) to spread out otherwise-synchronized events.
Stale-while-revalidateServe an expired value immediately while refreshing it in the background for future requests.
Lease (Facebook Memcache)Token-based single-flight: cache grants a "lease" to the first miss; other misses get told to wait/retry instead of hitting the DB.

Decision guide

Pick by constraint

Primary sources