We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
6 system design questions lean on this idea. Each walks through the full answer.
System Design Masterclass · Caching Strategies
Free preview: the first 2 parts of this 10-part lesson.
Already bought the course? Sign in to read the whole lesson.
this lesson is part of
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design courseread the rest of this lesson in
System Design Masterclass
Unlock this lesson and the 751 other paid lessons
$25 once, by PayPal
See the System Design coursein Caching Strategies
This lesson is part of the full System Design Masterclass. Unlock it along with 769 other lessons for a one-time payment.
One-time payment by card or PayPal
Get Lifetime AccessOne-time payment: UPI, card or netbanking
Get Lifetime Access18 Foundation lessons are free, no payment needed. Try them now
It is easy and good
“It is really nice and good Please join the course”
The stampede everybody knows is the concurrent one: a popular key expires and fifty requests arriving in the same millisecond all fetch it. Single flight fixes that, it has been measured three times already in this chapter, and it is half the subject.

The mechanisms that fix them are unrelated, and each does nothing for the other. Most discussions of stampede prevention describe only the left panel.

The cold start is over in a minute. What outlives it is that all of those entries now share an expiry schedule, and the refill repeats as a spike every time the time to live comes round.

With no jitter the busiest second issued 506 loads against a mean of 251. The cache was filled in a burst and every entry inherited that burst's timing.

2,038 loads in the first second is the cold start. The bumps at 60, 120 and 180 are the same entries expiring together, because they were all stamped at the same time.
Plot loads per second against time after a deploy. If you see bumps at multiples of your time to live, your entries are synchronised, and no amount of single flight will flatten them.