Skip to main content

Caching

Cache design, invalidation strategies, and implementation patterns.

Cache-asideApplication reads from cache first, populates on miss
Write-throughWrites go to both cache and DB simultaneously
TTL strategyExpiry-based invalidation, stale-while-revalidate
RedisData structures, pub/sub, Lua scripts, clustering
In-memorymoka, dashmap — thread-safe in-process caches