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 12-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”
Cache-aside is how nearly every cache in nearly every codebase is used. The application checks the cache, and on a miss it fetches from the source and stores the result itself. Nothing sits between the application and either the cache or the database.

That is the definition of the pattern and it is also every one of its properties, good and bad. The cache knows nothing about the database and cannot load anything on its own.

Every description of cache-aside lists the first three. The fourth is where the pattern's most-repeated advantage actually lives, and it does not exist unless somebody writes it.
The claim is that cache-aside degrades gracefully when the cache fails, because the cache is not on the critical path. The application simply talks to the database and carries on.

Read-through and unwrapped cache-aside answered nothing at all. Cache-aside with the cache call in a try block answered 13.0 percent of requests.

The third and fourth bars being identical is the finding. The fallback did not deliver resilience, it delivered the database's capacity.

A cache client throws on a connection failure like any other network call, and nothing about cache-aside catches that exception for you.
Read your own cache-aside code and find the failure path. If there is no try around the cache call, the application does not degrade to the database when the cache fails, it fails with the cache.