Surviving traffic spikes
Absorb sudden peaks, hot keys and thundering herds.
15 min readSpikes are normal
Launches, sales, viral posts and live events can multiply traffic in minutes. Autoscaling helps, but it takes time to react, so the design must absorb the first wave on its own.
Hot keys
Spikes are rarely spread evenly: one celebrity post or one tournament leaderboard receives most of the traffic. Hot keys overload a single cache shard or database row. Mitigate with replicated hot keys, short local caches, or by splitting one key into several.
Shock absorbers
Several tools keep a spike from becoming an outage.
- Caches and CDNs absorb repeated reads
- Queues absorb bursts of writes
- Load shedding and rate limits protect the core when demand exceeds capacity
- Request coalescing stops thousands of identical misses hitting the database at once
Key takeaways
- Design for peak traffic, not the average
- Hot keys need their own mitigation
- Queue, cache and shed load to keep the core alive
Sign in to track lessons and earn badges.