Study paths
10 ordered routes through the building blocks. Each one takes six or seven blocks in the order they depend on each other and ends in the problem that exercises them.
How to use a path
Read the blocks in order, one sitting each. Say the outcome sentence out loud when you finish. Then run the timed practice for the problem at the end and see whether the blocks show up in your answer unprompted.
The first thing every read-heavy system needs, from one cache to a global edge.
7 blocks
- Cache the hot reads
- Invalidate the cache when data changes
- Protect against a cache stampede
- Spread reads across replicas
- Let users see their own writes
- Serve static bytes from the edge
- Spread a hot key
Every distributed system retries; most do it wrong. This path makes retries harmless.
7 blocks
- Never wait forever
- Retry transient failures carefully
- Make retries safe
- Decouple producer from consumer
- Drop duplicate events
- Park poison messages
- Stop calling a failing dependency
What happens in the ten seconds after a database or cache node dies, and how to make it boring.
7 blocks
- Pull broken instances out of rotation
- Survive losing a node
- Make an expired lease harmless
- Tune reads and writes with quorums
- Agree on one leader or one value
- Spread across zones and regions
- Recover from bad data, not just dead disks
When one database node is not enough: how to partition, and the traps that follow.
6 blocks
- Partition the data
- Add nodes without remapping everything
- Fix a hot shard
- Generate unique ids without a central counter
- Append-heavy, time-ordered rows
- Shard by region
Moving from request-response to events without losing data or ordering.
6 blocks
- Decouple producer from consumer
- Fan one event out to many consumers
- Keep events as a replayable log
- Publish events reliably with the write
- React to database changes
- Coordinate a multi-service transaction
Pushing to a user the moment something happens, whether they are online or not.
6 blocks
- Push to the browser in real time
- Find which server holds a user
- Track online status cheaply
- Deliver to users who are offline
- Reach devices through platform push
- Simpler one-way push
Precomputing what users will read, and keeping it right when the source changes.
6 blocks
- Precompute on write, read cheaply
- Fix a hot shard
- Precompute joins
- Page results with a cursor
- Rank instead of sorting by time
- Protect against a cache stampede
The layered defence that keeps a service answering when traffic exceeds capacity.
6 blocks
- Limit requests per client
- Drop load before you fall over
- Admit only what you can finish
- Slow the producer when the consumer is behind
- Isolate failures
- Degrade instead of failing
Observability from the first alert to the exact slow span.
6 blocks
- Measure what users feel
- Set SLOs and spend the error budget
- Log so you can query
- Tag every log line with the request
- Follow one request across services
- Deploy without downtime
Every stage between a creator pressing upload and a viewer pressing play.
6 blocks
- Upload large files without touching your servers
- Keep large blobs out of the database
- Process uploads in parallel
- Stream video to any connection
- Serve static bytes from the edge
- Let browsers and proxies cache