System Design · Senior · Question 22 of 75

What is a cache stampede and how do you prevent it?

Explanation

When a popular key expires, thousands of requests hit the DB at once. Solutions: request coalescing (one recomputes, the others wait), stale-while-revalidate, random TTL jitter, warming.

Further reading

Problem with a question

System Design · Senior · question 22

Test yourself

Take the System Design · Senior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz