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.

Scaling reads

The first thing every read-heavy system needs, from one cache to a global edge.

7 blocks
  1. Cache the hot reads
  2. Invalidate the cache when data changes
  3. Protect against a cache stampede
  4. Spread reads across replicas
  5. Let users see their own writes
  6. Serve static bytes from the edge
  7. Spread a hot key

Making retries safe

Every distributed system retries; most do it wrong. This path makes retries harmless.

7 blocks
  1. Never wait forever
  2. Retry transient failures carefully
  3. Make retries safe
  4. Decouple producer from consumer
  5. Drop duplicate events
  6. Park poison messages
  7. Stop calling a failing dependency

Decoupling with events

Moving from request-response to events without losing data or ordering.

6 blocks
  1. Decouple producer from consumer
  2. Fan one event out to many consumers
  3. Keep events as a replayable log
  4. Publish events reliably with the write
  5. React to database changes
  6. Coordinate a multi-service transaction

Real-time delivery

Pushing to a user the moment something happens, whether they are online or not.

6 blocks
  1. Push to the browser in real time
  2. Find which server holds a user
  3. Track online status cheaply
  4. Deliver to users who are offline
  5. Reach devices through platform push
  6. Simpler one-way push

Staying up under load

The layered defence that keeps a service answering when traffic exceeds capacity.

6 blocks
  1. Limit requests per client
  2. Drop load before you fall over
  3. Admit only what you can finish
  4. Slow the producer when the consumer is behind
  5. Isolate failures
  6. Degrade instead of failing

Knowing what broke

Observability from the first alert to the exact slow span.

6 blocks
  1. Measure what users feel
  2. Set SLOs and spend the error budget
  3. Log so you can query
  4. Tag every log line with the request
  5. Follow one request across services
  6. Deploy without downtime