20 Mart 2023 Pazartesi

Cache Stratejileri - Cache Access Patterns Write-Around

Giriş
Veri tabanı güncellenir ancak cache güncellenmez. Cache verisi bayatlayınca veri tabanından son durumu okur.

Açıklaması şöyle
This strategy populates the underlying store but not the cache itself. In other words, the write bypasses the cache and writes to the underlying store only.
Açıklaması şöyle
Write request goes around the cache straight to DB and acknowledge is sent back, data is not sent to cache. Data is written to the cache when there is the first cache miss.
Açıklaması şöyle
In this design, cache entry only expires when exceeds the pre-set TTL. There is no cache invalidation nor cache update in the write path. The advantage is that the implementation is very simple, but at the cost of even more cache staleness — as long as the TTL window.
Dezavantajı
Açıklaması şöyle
Written data won't immediately be read back from cache
Ne Zaman Kullanılır
Açıklaması şöyle
This is often used when write volumes are large but read volumes are significantly lower.
Write-Around vs Cache-Aside
Açıklaması şöyle
The difference is that with Cache-Aside, the focus is on the reads and lazy loading — only populating the data into the cache when it is first read from the datastore. Whereas with Write-Around caching, the focus is on write performance instead. This technique is often used to avoid cache pollution when data is being written often but is infrequently read.




Hiç yorum yok:

Yorum Gönder