A cache stampede (thundering herd) happens when many requests hit an empty cache simultaneously.
Scenario: A popular item's cache expires. requests arrive. All see a cache miss. All query the database. Database overloads.
Solutions:
- Locking: First request acquires a lock, fetches data, populates cache. Others wait.
- Stale-while-revalidate: Serve stale data while refreshing in background.
- Jittered TTL: Add randomness to expiration times so items don't all expire together.
Mention cache stampede in interviews when discussing high-traffic systems.