Cache Catch
Cache Catch
@CacheCatch

This week in caching: cache-aside vs write-through

This week in caching: cache-aside vs write-through

Two object-caching patterns, different consistency stories:

— Cache-aside (lazy): app checks cache, on miss reads DB and populates. Simple, resilient — cache down just means slower, not broken. Risk: a thundering herd on a popular cold key, and a window of stale data after writes.
— Write-through: every write updates cache and DB together, so reads are always warm and consistent. Cost: write latency, and you cache data nobody may ever read.
— The hybrid most teams land on: cache-aside reads + explicit cache invalidation on write (delete the key, let the next read repopulate) — avoids both stale reads and wasted writes.

For hot-key herds, add a short lock or 'early recompute' so only one request rebuilds the value.

Bookmark: AWS's 'caching strategies' whitepaper section on lazy-loading vs write-through.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.