System Design Lab / Workbench / Challenges

System design · Beginner · about 5 min

Stop a cache stampede

The product page is cached. When its key expires at peak traffic, every request misses at once and rebuilds the same page in the database.

Start the challenge →

What breaks

Users → Load balancer → Product service → Product cache → Product DB. The cache fetches from the database on a miss; one rebuild takes 300 ms. The key expires at 0:12 and 0:25.

What you do

  1. Play and watch the database fill up when the key expires.
  2. Open Product cache and choose what happens on expiry.
  3. Play again and compare how many requests hit the database at once.
  4. Keep the cache and the database as they are: change only how misses are handled.

Runs in your browser. No sign-up needed. Numbers come from the Workbench simulator, not a real system.