Caching in distributed systems: A friendly introduction

preview_player
Показать описание
Caching is an amazingly effective technique to reduce latency. It helps build scalable, distributed systems.

We first discuss what is a cache and why we use it. We then talk about the key features of a cache in a distributed system.

Cache management is important because of its relation to cache hit ratios and performance. We talk about various scenarios in a distributed environment.

Benefits of a cache:

1. Saves network calls
2. Avoids repeated computations
3. Reduces DB load

Drawbacks of a cache:
1. Can be expensive to host
2. Potential thrashing
3. Eventual consistency

Cache Write Policies:
1. Write-through
2. Write-back
3. Write-around

Cache Replacement Policies:
1. LRU
2. LFU
3. Segmented LRU

00:00 What is a cache?
00:20 Caching use cases
03:42 Caching limitations
06:33 Drawbacks
09:42 Cache Placement

Caching resources listed together (click on the resources tab):

You can follow me on:

#Caching #DistributedSystems #SystemDesign
Рекомендации по теме
Комментарии
Автор

Please keep making these videos and continue this journey of system design in depth they're extremely helpful

RishabhGupta-oqbd
Автор

Waiting for this video for a long time 🎉

namanchandra
Автор

Bought your system design course after this video, I really hope it will be worth it and I am excited for this journey!!

shubhamjagtap
Автор

Really like your examples used while explaining something. Aspiring to become an engineering like you😀

ShailendraSingh-fl
Автор

Beautifully explained. Please keep sharing such imp videos and if possible attach PDF links too where can read further about the topic. Thanks.

pranaypaul
Автор

One correction: Videos are not stored in the database; instead, they are stored in the file system.

cthinkzz
Автор

can we write recent changes in the cache in when it comes to discard the entry from the cache we write that changes to the database, this way our db does not get behind because first we will be checking for cache, if it is in cache then it is latest,
by the way great video sir i admire you

KaustubhKolhe
Автор

i have one doubt that can we call cache as an database ?

failureboy
Автор

Caches are used to cache repeated queries so that you do not invoke hard compute and return pre calculated values, its usually not designed to reduce latencies. Latency reduction is the by-product of the less compute required to answer the question. Keep that in mind.

An SQL query requires alot more compute than returning it from file based or in-memory cache, it's faster and very efficient. Poor cache performance is often due to bad invalidation logic, limited cache sizes or taxing data structures stores inside a cache system.

Caching, Deadlocks, Synchronisation, Memory Management and Scheduling are the most simplest yet the hardest concepts in computer science if you don't do it right. The introduction only speaks about keywords at this point, how to make them work for you is the real engineering esp in a "distributed system" where caching is completely different concept comapred to single node or centralised caches. Redis as displayed in this illustration is still a centralised cache if all servers use it as server will see it as single entity behind sentinel cluster.

That being said, go and try yourself and see how it works rather than rely on half baked information.

MaulikParmar
Автор

How to handle data updates on cache? Would help if you show strategies too

ryan.aquino