Topic

System design

Design systems that grow and survive: load balancing, caching, APIs, queues and events, replication, sharding, consistency, failover and several regions, measured under load.

  • 21 hands-on labs
  • Beginner to advanced
  • DevOps plan

Opens with the DevOps plan. Cloud, AI, Data and Teams include it too.

Labs

21 labs in order. Beginner to advanced.

Each lab is a real machine built only for you, with a guide and checks that read what you actually did.

  1. Beginner

    From one server to three

    Measure a web app, put a load balancer in front of three copies of it, prove the copies made it faster, then crash one in the middle of a test and lose no request.

  2. Beginner

    Make a slow page fast

    Put a Redis cache in front of a slow catalogue with cache aside and an expiry, make updates show at once, let browsers keep static files, and measure the difference.

  3. Beginner

    An API clients can rely on

    Take a product API that works but wastes bandwidth, round trips and money, and add a second version beside it that pages, batches, caches safely and never charges twice.

  4. Beginner

    An edge cache in front of a far origin

    Put an edge cache in front of a slow, far away origin: measure what every visit costs, cache what the origin allows, survive an origin outage and ship a release without purging anything.

  5. Intermediate

    Move slow work off the request

    Move slow card charges off the request onto a Redis stream, then make the workers safe: a consumer group, acknowledgements, retries with back off, a dead letter stream, charging once, and three workers.

  6. Intermediate

    Read copies and consistency

    Build a PostgreSQL primary and a streaming replica on two machines, send a shop's reads to the replica and its writes to the primary, then make sure every customer sees their own writes.

  7. Intermediate

    Split data that no longer fits

    Spread a shop's orders over three PostgreSQL shards by customer, see why a fixed formula makes growth painful, switch to a directory, then add a shard and move customers to it safely.

  8. Intermediate

    Four ways to cache, four kinds of data

    Cache prices, page views, a home page and a deals list four different ways, write through, write behind, refresh ahead and request coalescing, and measure what each one saves.

  9. Intermediate

    Reports that never keep a customer waiting

    Move slow report building out of the request: a 202 with a status link, a worker, urgent and scheduled jobs, a burst absorbed by the queue, and back pressure with 429 and Retry-After.

  10. Intermediate

    Live updates for many browsers

    Replace polling with Server-Sent Events fanned out through Redis publish and subscribe, then make it survive reconnects, stalled browsers and updates that race each other.

  11. Intermediate

    Photos in object storage

    Run an S3 compatible object store, then stop carrying photos through the app with presigned links, keep payloads out of a job queue with a claim check, and serve a static site from a bucket.

  12. Advanced

    Fail well

    Watch a slow pricing service stall a whole shop, then make the shop fail well with a timeout, retries with jitter, a circuit breaker, a bulkhead, a fallback price and a rate limit per client.

  13. Advanced

    One front door for many services

    Put an NGINX API gateway in front of a shop's services: HTTPS with your own certificate, a route per service, an API key check, a secret the services trust, a BFF that combines answers, and discovery of new copies.

  14. Advanced

    Events and undoing steps

    Run a shop whose services talk only through events, add the compensating step that releases stock when a payment fails, then rebuild the read model from the event log.

  15. Advanced

    Move out of a monolith one route at a time

    Move a catalogue out of a monolith without a big rewrite: a facade in front, an anti-corruption layer at the boundary, a canary you can roll back, and a sidecar for the flaky old system.

  16. Advanced

    Find and fix what makes a service slow

    Measure a slow service, find its classic mistakes, N plus one queries, a connection per request, calls one after another, no caching and a retry storm, and fix each one with numbers to prove it.

  17. Advanced

    Consistency, quorums and a partition

    Run a key value store replicated on three VMs, cut one off with a real network partition, and see what small and majority quorums choose between availability and consistency.

  18. Advanced

    One leader, chosen by consensus

    Form a three node etcd cluster, use it to elect one leader so a scheduled job runs once, lose the leader and watch another take over, then see a fencing token stop a leader that woke up too late.

  19. Advanced

    Stay up when a machine dies

    Run a shop on two database machines behind a load balancer, lose the primary's machine, promote the standby, fence the old primary and report the availability customers saw against an objective.

  20. Advanced

    Two regions and a DNS failover

    Run a service in two regions behind your own DNS server, fail over when a region goes down, and measure the recovery time and the writes lost, before and after replicating synchronously.

  21. Advanced

    Capstone: a link shortener at scale

    Design a link shortener on paper, then run it on two machines with a cache, a primary and replica, a click queue and a load balancer, prove it meets a speed target and lose a machine mid test.

Learning paths

On these learning paths.