System design in 30 seconds: the cheat sheet (episodes 1 to 8)
The short version
System design is deciding how the parts of your app work together so it still works when a lot of people show up. Coding asks "how do I build this?" System design asks "how do I make this work at scale?"
This page is the whole series on one screen. Each episode gets one line in plain words, the picture to remember it by, the catch, and a prompt you can paste into your AI to check your own app. It grows as new episodes come out.
| # | Concept | In one line | Picture it as |
|---|---|---|---|
| 1 | System design | How servers, databases, APIs and cache work together at scale | The plan for the whole building, not one room |
| 2 | Scalability | Handling more users, requests and data while staying fast | A cafe when the queue gets much longer |
| 3 | Vertical vs horizontal | A bigger machine, or more machines | One stronger server, or ten copies of it |
| 4 | Load balancer | Decides which server gets each request | The restaurant host who picks your table |
| 5 | Reverse proxy | Sits in front of your servers and passes requests through | The waiter between you and the kitchen |
| 6 | API gateway | One entrance that checks, limits and routes every request | The airport entrance before your gate |
| 7 | Monolith vs microservices | One app, or many small services that talk to each other | One kitchen, or a food court |
| 8 | High availability | The app keeps answering when one part of it dies | A second pilot already in the seat |
Copy these prompts
Paste them into Claude Code (or any AI that can see your project). The first one tells you where you stand. The other two find the problems that hurt first.
1. Map my app against the series
Look at my project and tell me, in plain words, how it handles each of these: scaling up (bigger machine or more machines), load balancing, a reverse proxy, an API gateway, whether it is one app or several services, and what happens when one part goes down. For each one say whether I have it, whether my hosting provider is doing it for me, and where I can see it. Do not assume I know the vocabulary.
2. Find my bottleneck
If my app got ten times the traffic tomorrow, what breaks first? Check the database, anything that only lives on one server (sessions, uploaded files, in-memory state), and any slow call made on every request. Give me the single most likely failure, how I would notice it, and the smallest fix.
3. Find my single point of failure
List every part of my app where one thing going down takes everything down with it. For each one tell me what users would see, how long it would likely last, and whether my hosting provider already protects me from it.
The eight concepts
Read them in order. Each one builds on the one before.
1. System design: making it work at scale
You built an app and ten people use it. Then ten million show up. Where does all the data go? How many servers do you need? What happens if one crashes? How do you keep it fast? Answering those questions is system design.
The catch: none of it matters on day one. It matters the day your app gets popular, and that is the worst day to start learning it.
2. Scalability: surviving your own success
Scalability means handling more users, requests and data while the app stays fast and usable.
Think of a cafe with a much longer queue. You can buy a faster machine, or you can open another counter. Apps grow the same two ways: a more powerful server, or more servers sharing the work.
The catch: more servers do not fix everything. If every request still waits on one overloaded database, the database is the bottleneck. The usual fixes are better queries, caching, read replicas, and eventually splitting the data.
3. Vertical vs horizontal scaling: bigger, or more
Vertical is the same machine, made bigger. A server with 2 CPUs and 8 GB of memory becomes one with 8 CPUs and 32 GB. Same code, nothing to redesign.
Horizontal is more machines. You take one server and run ten copies of it, and each request goes to whichever copy is free.
The catch, vertical: there is a limit. Eventually there is no bigger machine to buy, and you still depend on one machine. If it dies, your app dies with it.
The catch, horizontal: ten copies have to behave like one app. If your login is stored only on server 1 and your next request lands on server 7, you are suddenly logged out. Shared things like sessions and data must live somewhere every server can reach.
Real apps use both. A common split is an API that scales horizontally and a database that scales vertically.
4. Load balancers: who gets the request
You have three servers and a thousand requests. Something has to decide where each one goes. That is the load balancer.
Picture a packed restaurant. You do not choose your table. The host looks around and sends you to one.
Two rules worth knowing:
- Round robin: take turns. Server 1, then 2, then 3, then back to 1.
- Least connections: send the request to whichever server is handling the fewest right now. Better when one server is already drowning.
It also keeps checking each server. If one stops responding, it stops sending traffic there. That is a health check.
The catch: a load balancer does not make your servers faster. Three slow servers are still three slow servers. It only makes sure you are using all three.
5. Reverse proxies: the one in the middle
A reverse proxy sits in front of your servers. Your request hits it first, it carries the request to a server in the back, and it brings the response to you.
Think of a waiter. You never walk into the kitchen. You tell the waiter, and the waiter brings the food.
Because everything passes through it, it picks up extra jobs:
- Hides your servers. An attacker cannot hit what they cannot see.
- Handles HTTPS, so each server does not have to.
- Caches common answers, so the server is not asked the same thing twice.
- Balances load. The load balancer from episode 4 is one more job a reverse proxy can do.
Common pick: Cloudflare. If you deploy on a platform like Vercel, one is already in front of your app and you never had to build it.
The catch: if the proxy goes down, everything behind it goes down too.
6. API gateways: the entrance that decides
An API gateway is one entrance for your whole app. Think of an airport: you do not walk straight onto the plane. One entrance checks your ticket, scans your bag, and points you to your gate.
It does three jobs:
- Authentication. It checks who you are.
- Rate limiting. It caps how many requests you can send. Go over and you get error 429, "too many requests".
- Routing. It sends you to the right service. Paying goes to payments. Tracking goes to orders.
How it differs from episode 5: a reverse proxy passes your request along. A gateway decides whether you are allowed in.
Common picks: Kong, AWS API Gateway, Cloudflare.
The catch: it is one more thing to set up, pay for, and keep running. If your app is still one service, do not bother yet. Once you split into several services, you will want one.
7. Monolith vs microservices: one kitchen, or a food court
A monolith is one app: one codebase, one deploy, one database. Think of one kitchen with one menu, one team and one till.
Microservices split the app into small services that each do one job and talk to each other over the network. Think of a food court: pizza, payments and delivery each get their own stall and their own staff.
Why anyone builds the food court:
- You scale just the busy part. If payments are slammed, you add cooks to payments, not to the whole building.
- One fire does not close everything. If one stall goes down, the rest keep serving.
- Big teams ship without waiting on each other.
The catch: every stall needs its own staff and its own till, and they shout orders across the hall. That is more things that can break and more servers to pay for. Amazon's Prime Video team moved one of their tools back from microservices to a single app and cut its cost by over 90%. Shopify's main app is still one big codebase and it handles Black Friday.
If it is you and an AI agent building your first app, start with one kitchen. Split a piece off only when it actually hurts. The API gateway from episode 6 is the front door you need once you do.
8. High availability: staying up when a part dies
High availability means your app keeps answering when one of its parts dies. It is counted in nines of uptime, and 99.9% sounds perfect until you see it is almost nine hours offline a year.
| Uptime | Down per year | Down per month |
|---|---|---|
| 99% | 3 days 15 hours | 7 hours 18 min |
| 99.9% (three nines) | 8 hours 46 min | 43 min 50 s |
| 99.99% (four nines) | 52 min | 4 min 23 s |
| 99.999% (five nines) | 5 min 16 s | 26 s |
Each extra nine cuts the downtime by ten, and costs more. You get there with three parts:
- A backup: a second copy of the server, already running. The second pilot, already in the seat.
- A health check: something that keeps asking the main server "are you OK?". Usually just a health page that answers "ok".
- Failover: when the main one stops answering, traffic moves to the backup.
The catch: a backup that shares the main one's weak spot goes down with it. Airlines give the two pilots different meals so one bad fish cannot take out both. Servers need the same thing: a backup in another building (another availability zone) survives a data centre going down, and one in another region survives a whole city going dark.
On Vercel, functions already run across multiple availability zones by default. What your host does not cover: your database, your cache, and every outside API you call (payments, AI, email). Two parts at 99.9% that a request needs at the same time give you about 99.8% together.
Your uptime checklist:
- Pick your target. 99.9% means about 44 minutes down a month.
- List everything one request touches and circle anything with only one copy.
- Add a health page that only says "ok" if the app can reach its database.
- Point a free uptime monitor at it so you hear about an outage before your users do.
- Check your database plan: is there a standby, and how long does it take to come back?
- In staging, switch the main one off on purpose and time how long until the backup answers.
Which one do I actually need?
Most apps built with AI tools on a modern host already have a load balancer and a reverse proxy without anyone choosing them. What you add depends on the complaint.
| What is happening | The concept | Start here |
|---|---|---|
| "It gets slow when a lot of people are on" | Scalability | Find the bottleneck before buying anything |
| "The server is maxed out" | Vertical scaling | A bigger machine is the fastest fix |
| "One server is not enough any more" | Horizontal scaling | More copies, with sessions stored somewhere shared |
| "Users get logged out at random" | Horizontal scaling | The login is living on one server |
| "One server is busy and the others are idle" | Load balancer | Check the balancing rule |
| "Someone is hammering my API" | API gateway | Rate limiting |
| "Every service checks logins its own way" | API gateway | Do it once at the entrance |
| "We are planning a dozen services and have no users" | Monolith | One app until a piece actually hurts |
| "When the database blips, the whole app is down" | High availability | Find the part with only one copy |
Go deeper
Four longer guides that pick up where an episode stops:
- Keep sessions working across multiple app servers, for episodes 3 and 4.
- Find the web cache that kept the old bug alive, for the caching job in episode 5.
- Put static assets near the users who load them, for what a CDN in front of your app does.
- Diagnose DNS propagation before a domain cutover, for the step before any of this: how a request finds your app.
Run this on your codebase
Review my project as a system design problem. Tell me what would break first at ten times my current traffic, where I have a single point of failure, what my hosting provider already handles for me (load balancing, reverse proxy, HTTPS, rate limiting, backups across availability zones), my realistic uptime today, and what I would have to add myself. Finish with the one change worth making this month and how I will know it worked. Use plain words and explain any term the first time you use it.