Reliability Patterns
The handful of techniques that recur across almost every system: idempotency keys, the transactional outbox, retries with backoff and jitter, circuit breakers, backpressure, and cache stampede protection. Learn each by the failure it prevents.
Lessons
- 01Make a retried payment safeA key chosen by the client marks repeated attempts as one operation, and it protects you only if it is stored durably alongside the effect.
- 02Stop writing to two placesWriting an event to a table in the same transaction as the business change replaces two unrelated writes with one atomic commit.
- 03Keep retries from sustaining an outageRetries add load at the moment a service has the least to spare, so they need spacing, randomness, and a hard limit.
- 04Stop slow work from spreadingA timeout bounds one wait, a circuit breaker stops calling a failing dependency, and load shedding refuses work a server cannot finish in time.
- 05Decide what happens when the queue is fullA queue absorbs bursts but not sustained overload, so it needs a limit and a deliberate rule for what happens at that limit.
- 06Survive a popular key expiringWhen a popular cache entry expires, every concurrent reader can miss at once, so rebuilds must be limited and expiries spread out.