We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
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”
Moving a cache out of the process is presented as a capacity and consistency upgrade: one copy instead of one per instance. Both of those are real. What the move also does is put a fixed price under every single hit.

Measured against a real on loopback, which is the most favourable network any cache will ever have. That 0.056 milliseconds is a floor, and it does not depend at all on what you put in the cache.

There is no way to draw these two on one axis honestly. This is measured with no network between them at all, so on a real deployment the first bar is several times longer than drawn.

A remote cache hit costs 0.056 ms and a local dictionary lookup of the same value costs 0.00004, which is a factor of 1,326.

Fifty rounds of sha256 takes 0.016 ms, which is a third of the fetch. Two hundred takes 0.061, which is just past it. Below that line the cache reports an excellent hit rate and makes the system slower.
A great deal of what ends up in is below this line: a formatted string, a small derived object, a parsed configuration value, a permission check over data already in memory. Every one of those is faster to redo than to fetch.