Draw the system twice: why one sketch is never enough?
FotoFlow has two million users and six new engineers starting next month, so the team finally writes the architecture down. The first attempt is one giant diagram: boxes, arrows, class names and table columns on the same page, and nobody can read it. The second attempt is worse: a new hire designs the courier-like upload flow in an interview as pure class diagrams and never mentions that photo ingest arrives 40,000 times a second.
The map: high-level design
High-level design, HLD, decides what the parts are and how they connect: which services exist and what each owns, whether they talk by call or by event, where each kind of data lives, and what happens when traffic grows or a part fails. It is the level of every article in this series so far. Its output is a one-page diagram with the reasoning written next to it; if a box needs a paragraph to explain, that paragraph belongs to the LLD of that box.
Every arrow and store on that diagram is a decision with an alternative. Uploads publish events rather than calling the transcode service, so a slow transcoder cannot block an upload; payments get a relational database because it needs transactions; view counts get a fast key-value store because they are tiny, hot and always overwritten. HLD and LLD answer different questions for different readers.
The room: low-level design
Low-level design, LLD, opens one box: the modules or classes it is made of, the interfaces between them, its tables and indexes, its algorithms and error handling. Inside the upload service, a controller takes HTTP requests, an upload service holds the rules, a repository talks to the store, and a client wraps calls to the virus scanner. LLD also pins down the state machine, an upload can be cancelled while pending or processing but not once stored, the table with its index on (user_id, created_at) for "my uploads", and the awkward cases: what if the scan call times out, or the same upload arrives twice. Most production bugs live at this level: a state nobody allowed for, a missing index, a retry that charges twice.
Where they meet
The two levels meet at contracts. HLD fixes what a component promises, its API and the events it publishes; LLD decides how it keeps that promise. That split is what lets teams work independently: the upload service can rewrite everything inside its box as long as POST /uploads and PhotoUploaded keep meaning the same thing. Changing a contract is an HLD change: other teams must agree, and old and new versions must coexist for a while.
What this does not solve
A diagram is a snapshot, and snapshots rot: services appear and disappear while the wiki page keeps last year's truth, quietly lying. Tie the document to decisions rather than boxes, date every change, and review it when the HLD changes, which is rare and worth recording anyway. And the wrong zoom is the classic interview failure: twenty minutes on class diagrams without the 40,000-ingest number, or perfect boxes with no answer to "what if the scan is slow." Work top-down: requirements, numbers, then dive where the hard problems are. A design session runs: requirements, estimates, API, data model, HLD, deep dives, failure cases.
Open the last architecture diagram your team made. Which boxes no longer exist, and who would notice?
Your service's main API: if another team changed one field of it today, whose build would fail first?
The method is in hand; now it gets exercised end to end. Next in the series: FotoFlow wants short share links: could you design one today?
Sources
System Design Primer
Google SRE Books
Designing Data-Intensive Applications
Recommended for you
- Craft & Skills
One server, 10 million users: how does a photo app survive that?
A 40-post series that follows FotoFlow, a photo app, from one server and 100 users to 10 million users with direct messages. One problem, one fix, one honest cost at a time.
- Craft & Skills
Ten million users want direct messages: could you design the chat system?
The final design: 20 million open sockets and a promise that every message arrives, in order, exactly once. Dumb gateways, a connection registry, store-first durability and sync by cursor.
- Craft & Skills
Five million home feeds: how do you build the page everyone opens?
The home feed must load in 200 ms from two hundred followed accounts. Fan-out on read melts at 4.6 million lookups a second; fan-out on write melts on celebrities; the hybrid survives both.
- Craft & Skills
FotoFlow wants short share links: could you design one today?
The first full design walkthrough: turn a one-line brief into numbers, the simplest system, then fix codes, caching, storage and abuse one bottleneck at a time. The method is the point.
Enjoyed this article?
Subscribe for new articles. No spam. Unsubscribe anytime.
Typed live, never pasted.