Concepts/4. Performance/Cache Stampede (Thundering Herd) Defense
🦬
4. PerformanceAdvanced🔒 LOCKED FOR FREE TIER

Cache Stampede (Thundering Herd) Defense

← All 150+ Concepts

Occurs when a heavily requested hot key expires and thousands of concurrent requests simultaneously miss the cache and overwhelm the underlying database.

STAFF ENGINEER TAKEAWAY: Mitigate with Mutex Locks (single-flight) or Probabilistic Early Expiration (XFetch algorithm).
🔒

Unlock Cache Stampede (Thundering Herd) Defense & All 150+ Visual Architecture Deep Dives

This advanced distributed system deep-dive includes interactive packet visualizers, state machine transitions, and FAANG interview trade-off blueprints.

More Topics in 4. Performance

⚡Distributed Caching Strategies

High-speed in-memory key-value data stores positioned in front of slower relational databases to reduce read latency from 20ms to <1ms.

🌍Content Delivery Networks (CDN)

A geographically distributed network of proxy edge servers that caches static assets (images, videos, JS/CSS) and terminates TLS close to end users.

📦Cache-Aside (Lazy Loading) Pattern

The application code explicitly queries the cache first. On a cache miss, it reads from the database and populates the cache for subsequent requests.

✍️Write-Through Caching Pattern

Data is written simultaneously to the cache and the primary database in a single synchronized transaction before acknowledging the client.