Degraded

Cache stampede: when a cold cache floods the database

A cache stampede happens when a cache suddenly stops answering most reads — after a restart, a flush or a mass expiry — and every miss goes straight to the database at once.

What causes it

A warm cache with a 90% hit ratio sends only 10% of reads to the database. Empty it and the database receives ten times its normal read traffic instantly — often far beyond its capacity. Connections fill up, latency explodes, and the cache cannot warm up because the database is too slow to answer the misses.

How to recognise it

The math

Database load = λ_read × (1 − hit ratio) + λ_write

How to fix it

Reproduce it in the simulator

These templates trigger this failure on purpose:

Open the simulator

Learn more

Part of the guide Caching in system design.

Related failure modes