A reading room for engineers
System design notes
What happens when the cache is stale, the queue repeats a message, or every buyer wants the same seat? Work through the decisions, one note at a time.
Placing data
Serving traffic
- 02.01 The cache was invalidated. Then an old value came back. A delete event can win the race and still leave stale data in the cache.
- 02.02 The bucket has tokens. The service is still overloaded. Burst allowance, sustained rate and work already in flight protect different limits.
- 02.03 The socket only carries the live edge Own each connection on one gateway, bound its backlog, and recover missed events from durable history.
Surviving failure
- 03.01 The payment timed out. Did it go through? Keep the identity of an operation separate from the request that happened to carry it.
- 03.02 A queue hands work to a worker. A log lets you replay it. Redelivery recovers one unfinished task; replay rebuilds a consumer from retained history.
- 03.03 The payment arrived after the seat hold expired One database invariant must decide who owns the seat when clocks and callbacks disagree.