Caching Strategies: Cache Aside, Write Through, and Cache Invalidation
We walk the request path for the four cache strategies — cache aside, read through, write through, write back — tracing which component owns the cache and who gets blocked when it misses. The interesting part is invalidation: we simulate the race where the writer updates the database, the reader fills the cache with the old value, and the two orders of operations that prevent it. We also measure what each strategy does to p99 latency and to write durability, so the choice between them is visible as cost, not opinion.
Topics covered:
- Cache aside: application-driven loads and the stampede problem
- Read through and write through, and where the lock lives
- Write back and the durability window
- The stale-read race, and TTLs as a safety net
- Cache eviction and why it can behave like a crash
Related articles
Leader-Follower vs P2P Architectures
Quorum write cost, gossip convergence time, and when peer-to-peer wins — CDNs, blockchains, and systems that can live without ordering.
Caching Layers and TTL Tradeoffs
Cache-aside vs write-through, when TTL beats invalidation, and how to survive cache stampedes and miss storms without melting the database.
A Load Balancer Is Not a Magic Box
Layer 4 vs layer 7, hashing vs health checks, stickiness, and the failure modes hiding behind the most over-trusted building block in web infrastructure.
More in System Design
Load Balancers, Explained
Layer 4 vs layer 7, health checks, stickiness, and the failure modes behind the most trusted box in your architecture diagram.
WatchSearch System Design: Inverted Indexes, Tokenization, and Ranking
How a search system actually works — inverted indexes, tokenization, relevance ranking, and the pipeline between a keystroke and ranked results.
DetailsNotification System Design: Fanout, Retries, and Delivery Channels
Designing a notification system — provider abstraction, fanout, retry policies, and how push, email, and SMS channels fail differently.
DetailsChat System Design: WebSockets, Presence, and Message Ordering
Designing a chat system — WebSocket connections, message ordering, presence, and what happens to undelivered messages when a client goes offline.
DetailsRate Limiter Design: Token Bucket, Sliding Window, and Distributed Limits
How rate limiters actually work — token bucket, fixed window, sliding window, and what breaks when the limiter spans multiple machines.
DetailsURL Shortener System Design: Encoding, Storage, and Redirects
Designing a URL shortener — base62 encoding, ID generation, redirect caching, and how the write and read paths differ in scale.
DetailsMessage Queue Design: Topics, Consumer Groups, and Delivery Guarantees
How message queues actually work — topics, partitions, consumer groups, exactly-once semantics, and what guarantees the broker really gives.
DetailsDatabase Replication Topologies Visualized: Leader, Multi-Leader, and Quorum
How database replication topologies actually work — single leader, multi leader, quorum, and what happens to reads and writes when a node fails.
DetailsLoad Balancer Algorithms: Round Robin, Least Connections, and Hashing
How load balancer algorithms actually distribute requests — round robin, least connections, IP hashing, and the trade-offs each one makes.
DetailsDepth, delivered weekly
One technical dispatch a week — articles and episode notes before they go public.
One technical dispatch per week. No noise.