We use analytics cookies.We use cookies to analyze site traffic and improve your experience.
Loading...
4 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 9-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 last lesson ended with a claim: memcached decided differently on nearly every question, and the two designs are both coherent, not one modern and one dated. A claim like that has to be measured or it is a table copied from a comparison post.
So a real memcached and a real redis-server were started side by side on one machine and asked the same three questions.

Both servers were given the same 5 MB value, the same small key and the same client behaviour. The only difference is that memcached hands each connection to one of four threads.
This is the axis people usually get backwards. memcached is not faster than , and idle they measured the same to three decimal places. It is less affected by what other clients are doing, which is a different property and it only appears under load.

The big reader multiplied the small GET's 99th percentile by 1.3 on memcached and by 32.4 on , from an idle 0.021 ms on both.

Bars one and three are the two servers with nothing else happening. Bar two is memcached under interference, and bar four is Redis under exactly the same interference.
Choose between them on this axis only if your workload actually has commands of wildly different cost. If every operation is a small GET or SET, the two servers measure the same and the decision belongs to the other differences in this lesson.

That is what removed the blocking in the measurement. It is also the reason the protection is partial: the clients sharing a thread with the slow one still wait.
Read the result as a reduced blast radius, not an escape from it. A slow operation on memcached still stalls whoever is behind it on that thread, and the improvement is that the other three quarters of the connections never notice.