System Design Advanced
Cache Stampede: Beat the Thundering Herd in Redis
Stop cache stampedes with locking, single-flight, and probabilistic early expiry.
11 min read·Kodetra Technologies
2d agoHow-to content for builders, indie hackers, and AI engineers. Less theory, more shipped code.
System Design Stop cache stampedes with locking, single-flight, and probabilistic early expiry.
System Design Send a backup when the first call is slow. Cut P99 tail latency without overloading services.
Backend Build a reliable production job queue using only Postgres FOR UPDATE SKIP LOCKED.
System Design Stop drowning consumers. Pull, drop, and credit-based backpressure with code.
System Design Partition systems into isolated cells to cap blast radius and survive failures gracefully.
System Design Guarantee events publish even when Kafka is down. Outbox pattern with Postgres, step-by-step.