The problem
Popular key expires. 1000s of concurrent requests see cache miss. All query DB. DB CPU spikes. Cascading failure.
Advertisement
The problem
Popular key expires. 1000s of concurrent requests see cache miss. All query DB. DB CPU spikes. Cascading failure.
Advertisement
Locking (single-flight)
First miss acquires a lock. Others wait. Winner writes to cache. Waiters see fresh value. Redis SETNX + wait pattern.