Multiple ChoiceHard 45s
Cache stampede / thundering herd
A popular key with a 60s TTL expires during peak traffic. Thousands of concurrent requests miss and all hit the DB. Which mitigation is most targeted?
Options
- 1Use a per-key mutex or single-flight so only one request recomputes while others wait for the result
- 2Increase the DB connection pool size so the database can absorb all the concurrent cache-miss queries without queueing
- 3Disable TTLs entirely and rely purely on LRU eviction, so curated hot keys never expire and never trigger a stampede
- 4Replicate the database to add read capacity, so the extra replicas collectively absorb the burst of cache-miss lookups
Think you can answer under pressure?
Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.