Build the system. Survive the day.
Learn system design, one idea at a time
41 free lessons, from requests and caching to consistency, data storage and leading a design discussion. Follow the tracks or choose one idea.
Start
- 3 minutes
Your first system
Build a tiny app in three minutes and keep it standing through a rush of visitors.
- 3 minutes
What a request is, and p50 versus p99
A request is one question and one answer. Averages hide the slow ones that people remember.
- 3 minutes
Numbers you can do in your head
Turn monthly users into requests per second and servers needed, with a pencil.
Scale the front
- 3 minutes
Spreading load
A load balancer hands each request to a free server so none is overwhelmed.
- 3 minutes
Remembering answers
A cache keeps recent answers in memory so the database is asked less.
- 3 minutes
Copies near users
A CDN keeps copies of files and pages close to people, so your servers see far fewer requests.
- 3 minutes
Adding servers, and why it is late
Autoscaling adds servers when busy, but new servers take minutes to start.
Scale the data
- 3 minutes
Copies are a little behind
Read copies share the load, but they trail the original by a moment.
- 3 minutes
Splitting data
When one database cannot take the writes, split the data across several.
- 3 minutes
When one item is popular
Sharding spreads keys, not popularity. One star item can still overload one shard.
- 3 minutes
Search is a copy
A search index is a second copy of your data, shaped for finding words fast.
- 3 minutes
Hot, warm, cold and archive
Old data is rarely read, so keep it somewhere cheaper and slower.
Work later
- 3 minutes
Waiting instead of breaking
A queue lets a burst wait in line instead of crashing the thing behind it.
- 3 minutes
One post, millions of feeds
A post by a celebrity must reach millions of feeds; do it in the background.
- 3 minutes
Live sockets and presence
Chat and live scores keep a connection open; that changes how you count capacity.
Stay correct
- 3 minutes
Which copy is the truth
With several copies, you choose between always-latest and always-fast.
- 3 minutes
Exactly once, on purpose
Retries are normal, so every action must be safe to repeat.
Stay up
- 3 minutes
Saying "slow down" politely
A limit per client stops one noisy caller or a flood from taking everyone down.
- 3 minutes
Timeouts and failing fast
When a dependency is slow, give up early so your servers do not pile up waiting.
- 4 minutes
Surviving a region
A whole region can go dark. Run in two, and send people to the one that is up.
- 3 minutes
Seeing problems early
You cannot fix what you cannot see: metrics, alerts and a way back.
Business
- 3 minutes
Where the money goes
Every box has a monthly price. Good design meets the goal without waste.
- 3 minutes
Proof built in
Auditors want proof: who did what, who can see what, and that data is protected.
- 3 minutes
GPUs, tokens and fallbacks
Serving AI answers is slow and expensive, so cache, limit, and have a fallback.
Go deeper
- 7 minutes
Consistent hashing and moving data
Adding one machine can mean moving a little data or nearly all of it.
- 7 minutes
Copies and quorums
Copies tolerate failures when placement, acknowledgements and repair match the promise.
- 7 minutes
Agreeing on one leader
A leader needs a safe election and a way to stop old owners from acting.
- 7 minutes
What consistent really means
Choose the guarantee for each operation and name what a partition changes.
- 7 minutes
Inside a storage engine
The path from a write to disk decides memory, I/O and cost.
- 7 minutes
Work across services
Make each step durable and show the user what is still pending.
- 7 minutes
Ordering and time
A timestamp can sort events without proving which event caused another.
- 7 minutes
Syncing across devices
Offline edits need durable local intent, a cursor and a plan for old devices.
- 7 minutes
Privacy by design
The safest data to protect is data the service never receives.
- 7 minutes
How metrics systems work
Series count, replication and query work decide the size of a metrics platform.
- 7 minutes
Logs and traces
Keep enough evidence to explain failures without indexing or retaining everything.
- 7 minutes
SLOs and error budgets
Turn a user promise into a budget and an actionable alert.
- 7 minutes
Many customers on one system
Fairness and failure boundaries matter as much as total capacity.
Lead the design
- 6 minutes
How to lead a design interview
Use the hour to make decisions, test assumptions and invite useful disagreement.
- 7 minutes
The simplest thing that works
Include people, failure recovery and future triggers in the cost of a design.
- 7 minutes
Changing a running system
A safe migration preserves compatibility through the whole rollback window.
- 7 minutes
Designs that other teams must live with
A boundary is a contract and an operating responsibility, not just a box.