2026 field guide

Refreshed for cloud-native, multi-region, streaming, and AI infrastructure.

Explore 41 concepts →
Search DistillSys

Find a concept

Type at least two characters to search lessons, designs, papers, and interview prep.

Storageintermediate7 min read

Distributed Caching

Reduce latency and origin load while making staleness, invalidation, and failure behavior explicit.

2–5 minute refresher
Mental model

A cache is a bounded, disposable replica with a deliberately weaker freshness contract.

30second
refresher
Distributed caches keep derived or copied data near readers. Their value comes from a clear freshness contract, stable key design, bounded memory, and predictable behavior when cached data or the cache fleet disappears.

What problem does it solve?

Without caching, popular reads overload origins. With careless caching, stale data violates invariants, hot keys stampede the origin, and cache failure becomes a fleet-wide incident.

How it works

  1. Classify data by freshness and safety requirements.
  2. Choose cache-aside, read-through, or write-through deliberately.
  3. Set TTLs with jitter and explicit invalidation where needed.
  4. Coalesce misses and protect origins with concurrency limits.
  5. Measure latency and origin work by hit, miss, stale, and error path.
Decision guide

Key trade-offs

ChoiceWhat you gainWhat it costs
Long TTLHigher hit rateMore staleness
Explicit invalidationFaster freshnessLost or reordered invalidations
Serve staleAvailability during failureWeaker consistency
What happens if?

A popular key expires everywhere

Thousands of requests miss simultaneously and regenerate the same value, overwhelming the database. Request coalescing, soft TTLs, jitter, and stale-while-revalidate limit the stampede.

Where it appears

  • API response caches
  • Feature stores
  • Session caches
  • Model artifact caches
Senior interview modeWhen should a cache fail open versus fail closed?Show answer
Fail open with stale data only when the product invariant allows it. Authorization, balances, and revocation often fail closed; feeds and recommendations can usually serve bounded stale results.
#cache#invalidation#stampede#TTL