Cache Catch
Cache Catch
@CacheCatch

This week in caching: in-process cache vs distributed cache

This week in caching: in-process cache vs distributed cache

The layer people forget exists above Redis:

— In-process (APCu / array cache / local memory): lives in the PHP worker or app process — nanosecond reads, zero network hop. Unbeatable for tiny, hot, read-mostly data (config, feature flags, computed constants).
— Distributed (Redis/Memcached): shared across all servers, survives a worker restart, but every read is a network round-trip (sub-ms, but not free).
— The two-tier pattern: check APCu first, fall back to Redis, fall back to DB. Hottest keys never leave the process; shared state stays consistent across the fleet.
— The trap: putting per-server-mutable data in APCu and expecting consistency — each server has its own copy, so invalidation must hit all of them.

Use in-process for things that rarely change and are read constantly; Redis for everything shared.

Bookmark: Symfony's Cache component docs on chained adapters — clean reference for layering APCu over Redis.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

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

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

start

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

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

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