Defending Against the Thundering Herd
Learn how cache stampedes happen when popular keys expire, and the techniques to prevent them: request coalescing, locks, early recomputation, and jittered TTLs.
The Thundering Herd Problem
When a hot cache key expires, every concurrent request misses at once and rushes the origin together. This cache stampede (or thundering herd) can overwhelm the database in an instant.
Why It Is Dangerous
A single popular item serving 10,000 requests/second normally hits the cache. The moment it expires, those 10,000 requests all hit the database simultaneously, often causing a spike that takes the origin down.
All lessons in this course
- Common Caching Patterns
- Cache Invalidation Strategies
- Cache Eviction Policies
- Defending Against the Thundering Herd