Caching interview question · Most asked

Explain the difference between cache penetration, cache breakdown and cache avalanche.

Summary

Penetration: requests for data that doesn't exist bypass the cache every time. Breakdown (stampede): one hot key expires and many requests rebuild it at once. Avalanche: many keys (or the whole cache) disappear at once and the database takes all the load.

Longer Answer

Fixes differ: negative caching and Bloom filters for penetration; request coalescing, locks, early refresh or stale-while-revalidate for breakdown; TTL jitter, bounded database fallback, replication/persistence and warming for avalanches.

Key Points

  • Penetration: missing keys
  • Breakdown: one hot key expires
  • Avalanche: mass loss/expiry
  • Different protections for each

Deep dive: Database Caching at Scale

More most-asked Caching questions

← All Caching questions