System Design From First Principles

From one order on one server to systems that survive millions of people.

62 open lessons · practice and review with a pass

Part 0: The first order

How one request travels, how to design anything, and the numbers that change decisions.

Part 1: From one box to many

Scale a single service: more servers, caches, a CDN and a clean API. Then two complete designs.

Part 2: Inside the database

Open the box everyone treats as magic: pages and B+trees, the log that survives a crash, isolation, query plans, LSM trees and the NoSQL family.

Part 3: Data that will not fit on one machine

Copies, slices, agreement: replication, partitioning, consistency and consensus, then a store and a cache built from them.

Part 4: Many people talking at once

Asynchronous work and real-time delivery, then four designs that depend on them.

Part 5: Big files and endless streams

Logs and Kafka from the inside, then video, file sync and crawling, and seeing inside it all.

Part 6: Scarce things and real money

Where things are, who gets the last one, and money that must never be wrong across several services.

Part 7: Working together, everywhere

Surviving failure, editing together, serving an LLM, and going global.

Part 8: Running it for real

Change it without downtime, size it and pay for it, secure it, and write the decision down. Then design on your own.

Side quests

Classic designs, each grown from a lesson you already know.

  • Unique ID generator: How do many machines hand out unique, roughly time-ordered ids without asking each other?
  • Real-time leaderboard: How do you rank 200,000 people live and show anyone their position instantly?
  • Ad-click aggregation: How do you count clicks per minute correctly when events arrive late and twice?
  • S3-like object store: How do you keep petabytes safe without storing everything three times?
  • Distributed email: How do you store years of mail cheaply and still search it in a second?
  • Maps and routing: How do you find the fastest route across a city graph of millions of roads in milliseconds?
  • Digital wallet: How do you build a balance that can always be proved, event by event?
  • Stock exchange: How does an exchange order millions of bids fairly in microseconds?
  • Distributed job scheduler: How do you run every scheduled job once, on time, when machines die?
  • Spanner and TrueTime: How can a database spread over continents still order every transaction?

Open the course