RUVIDEO
Поделитесь видео 🙏

System Design - Cache | Caching | Cache Invalidation | Cache Eviction

Caching:
- Caching works on locality of reference principle: recently requested data is likely to be requested again.
- It's like short-term memory which has limited space but is faster & contains most recently accessed items.
- Cache can be used in almost every layer: hardware, OS, Web browsers, web application, but are often found nearest to the front end.
- Types of cache:
- Application server cache:
- Placing a cache on request layer node enables the local storage of response data. When a request is made, node will quickly return the cached data, if exists. If not it'll query from disk.
- But when you've many nodes with load balancer, it randomely distribute across the nodes, the same request will go to different noodes, thus increasing cache misses
- Two choices are to overcome this: global cache & distribute cache.
- Distribute Cache:
- In it, each of its nodes own part of cached data.
- The cache is divided up using a consitent hashing function, such that if a request node is looking for a certain piece of data, it can quickly know where to look within distributed cache to check if data is available.
- Easily we can increase the cache space just by adding nodes to the request pool
- Global Cache:
- In this, all nodes use the same single cache space. Each of the request nodes queries the cache in the same way it would a local one.
- There can two type of global cache:
- First, when a cached response not found in cache, cache itself becomes responsible for retrieving the missing peice of data.
- Second, it's the responsibility of request nodes to retrieve any data that is not found. It can be used when low cache hit % would cause the cache buffer with cache misses. In this situation, it helps to have a large % of data set in cache.
- CDN
- It's Content Distribution Network for serving large amount of static media which is common to all.
- First request ask the CDN for data, if not cdn will query the back-end servers & then cache it locally
- If your system is not that big for CDN, you can serve static media from a seperate subdomain using a lightweight HTTP server like Nginx
- Cache Invalidation
- When data is modified in DB, it should be invalidated in the cache.
- write-through cache:
- Data is written into the cache & the DB at the same time.
- This allow cached to be fast
- Data consitency also there between cache & DB, which make sure nothing get lost in case of power failure
- This minimizes the risk of data loss, but has disadvantage of higher latency for write operations.
- write-around cache:
- Data is written directly to storage, bypassing the cache.
- This reduces flooded write operations but has disadvantage that a read request for recently written data will create a cache miss & must be read from slower back-end.
- write-back cache:
- Data is written to cache alone & completion is immedialtely confirm to client & write to permanent storage is done after specified intervals.
- This results in low latency & high throughput, however this spped comes with the risk of data loss in case of crash.
- Cache eviction policy
- FIFO
- LIFO
- LRU (Least Recently Used): Implement using Doubly Linked list & a hash function containing the reference of node in list
- Most Recently Used
- Least frequently Used
- Random Replacement

In this video, we're going to reveal Cache used in System Design:
- What is Cache/Caching
- Where it can be added
- Types of Cache
- Cache Invalidation
- Cache Eviction Policies


★☆★ SUBSCRIBE TO ME ON YOUTUBE: ★☆★
https://www.youtube.com/codingsimplified?sub_confirmation=1

System design cache
How to implement cache in system design
cache computer,
cache memory,
cache definition computer,
cpu cache,
cache memory types,
cache data,
How to update data in cache
How to Evict data from cache
What is LRU

CHECK OUT CODING SIMPLIFIED
https://www.youtube.com/codingsimplified

I started my YouTube channel, Coding Simplified, during Dec of 2015.
Since then, I've published over 200+ videos. My account is Partner Verified and I get my earnings direct deposited into my account every month.

★☆★ VIEW THE BLOG POST: ★☆★
http://thecodingsimplified.com

★☆★ SEND EMAIL At: ★☆★
Email: [email protected]

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «System Design - Cache | Caching | Cache Invalidation | Cache Eviction», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.