Skip to content

Distributed Systems

Everything that goes wrong once there is a network in the middle.

partial failuresCAP theoremeventual consistencyidempotencyretriestimeoutscircuit breakersbackpressuredistributed locksconsensusevent streaming

Lessons

  1. 7.1Kafka and event-driven systemsInstead of phoning five services after every booking, write it down once and let each one read it when it's ready. 30 min Kafka playground Payment succeeded, booking crashed
  2. 7.2Partial failures: when part of the system breaksOnce a request crosses a network, "it worked" and "it failed" get a third sibling: "no idea". Here's how to live with it. 30 min Payment succeeded, booking crashed Retries, backoff and circuit breakers
  3. 7.3CAP, PACELC and consistencyWhen two copies of your data can't talk, you must pick: refuse to answer, or answer and risk being wrong. 30 min CAP: partition the network
  4. 7.4Idempotency and safe retriesNetworks fail, so you'll always need to "try again". Here's how to try again without charging a guest twice. 30 min Booking API playground Payment succeeded, booking crashed
  5. 7.5Timeouts, backoff and circuit breakersA broken service is annoying. A slow one can freeze your whole platform. Here's the small toolkit that stops that from happening. 30 min Retries, backoff and circuit breakers Latency percentiles
  6. 7.6Sagas and distributed transactionsA booking touches rooms, payments, points and email, each with its own database. There's no single "save all" button, so here's what you do instead. 30 min Payment succeeded, booking crashed
  7. 7.7Consensus, leader election and distributed locksHow a group of machines agrees on one boss and one story, even when some crash or can't hear each other. 30 min CAP: partition the network

On the job: try it on your own project

Ask Claude Code to list every call your app makes to another service or external API, with its timeout, retry policy and what happens if it fails halfway. Mark calls with no timeout, retries that are not idempotent, and multi-step flows with no rollback. Write a short failure-mode table and choose the one fix you would ship first.

Can you do this now?

0/4. Anything you can't tick yet: reopen that lesson's practice ladder.