Summary#
System design is a sequence of decisions made under uncertainty. A good process makes those decisions in the right order, and makes each one visible, so you can check it against what users actually need. This page gives you one method that works both on the job and in an interview:
- Requirements: what must the system do (functional), and how well (non-functional, with numbers)?
- Estimates: only the numbers that change the design: peak QPS, storage growth, hot-key skew, fan-out.
- Core entities: the nouns the system stores and exchanges.
- API: the contract between the system and its clients.
- Data flow (optional): the sequence of steps for processing-heavy systems.
- High-level design (HLD): boxes and arrows that satisfy every API call, built one endpoint at a time.
- Deep dives: harden the design against the non-functional requirements, edge cases and bottlenecks.
- Trade-offs: state what each choice costs and why you accept that cost.
- Evolution: how the design changes at 10× scale, and what you'd build first.
The same nine steps apply at work, but the job adds things an interview can't: existing systems, teams, budgets, migrations and months of operation. At work you also write the decisions down: a design doc for the whole proposal, and architecture decision records (ADRs) for individual choices. Before building, a design review checks the proposal against a checklist. The page ends with a worked mini example that walks all nine steps on a small, realistic system.
This page sits at the top of the playbooks. It links each step to the concept pages that cover it in depth. If you're preparing for an interview, read The System Design Interview Framework next, which adapts this process to a 45- or 60-minute conversation.
Why It Exists#
Most system design failures aren't caused by choosing the "wrong database". They're caused by solving the wrong problem, solving the right problem in the wrong order, or making a decision nobody can later explain.
- Solving the wrong problem. A team builds a globally replicated, strongly consistent store for a feature that 2,000 internal users touch once a day. Another team builds a single-node service for something that gets a 50× traffic spike every time a celebrity posts. In both cases the design was internally coherent but not matched to the requirements, because nobody wrote the requirements down with numbers. Requirements Gathering: From Problem Statement to Scope and Non-Functional Requirements and How They Drive Design exist to prevent this.
- Solving things in the wrong order. Engineers love interesting problems. Left unstructured, a design discussion jumps straight to sharding strategy or cache invalidation before anyone has agreed what the API is. The result is a beautifully optimised component inside a system that doesn't work end to end. In interviews this is the single most common way to fail: candidates run out of time without delivering a working system, and it shows up in feedback as "time management".
- Decisions nobody can explain. Two years later, someone asks "why do we use Cassandra here?" and nobody knows. Was it for write throughput, multi-region, or because the original author liked it? Without the reasoning, the team can't tell whether the reason still holds, so they either keep a bad choice out of fear or rip out a good one out of ignorance.
A design process addresses all three. It forces requirements before solutions, simple before complex, and written reasoning alongside every significant decision.
There's also an economic argument. The cost of changing a decision grows the longer it lives. Choosing a different database during a whiteboard session costs nothing. Choosing it after a prototype costs a day. Changing it after two years of production data, with 40 services depending on its semantics, can cost a multi-quarter migration (see Online Data Migrations and Schema Evolution). A process front-loads cheap thinking to avoid expensive rework.
Not every decision deserves the same care, though. Jeff Bezos's 2015 letter to Amazon shareholders distinguished Type 1 decisions (one-way doors: hard or impossible to reverse, so they deserve slow, careful deliberation) from Type 2 decisions (two-way doors: easy to reverse, so they should be made quickly by small groups). Much of good design process is telling the two apart:
- One-way doors need deep analysis, written trade-offs and review. Examples: the primary datastore, the partition key of a 10 TB table, a public API contract, the event schema that 30 consumers depend on, a choice of cloud provider.
- Two-way doors should be decided fast and revisited later if needed. Examples: which HTTP framework, the cache TTL, the initial instance size, the internal module layout.
Spending a week on a two-way door wastes time; spending an hour on a one-way door creates risk.
The process also helps when you're stuck. If you're overwhelmed (a huge problem, an unfamiliar domain, a nervous interview), the steps give you a track to run on: "I don't know how to shard this yet, but I do know what my entities are, so let me write those down." Progress on the next small step often unblocks the big one.
How It Works#
The method is nine steps, but it isn't a waterfall. Each step produces an artefact that the next step builds on, and later steps often send you back to revise earlier ones. A deep dive might reveal a missing requirement; the HLD might reveal a missing entity. The order matters because it keeps you from optimising before you understand, but you'll loop back.
The first four steps (requirements through API) are about understanding the problem. They should take a small fraction of the time, about 10–15 minutes of a 45-minute interview, or a few days of a multi-week design effort. Steps 6 and 7 are where the actual design happens. Steps 8 and 9 make the design defensible and durable.
Step 1: Requirements#
Requirements turn a one-sentence prompt ("design a ride-sharing app") into a bounded problem. They come in two kinds.
Functional requirements are what the system does, written as "users (or clients) should be able to…" statements. Real products have hundreds of features; your job is to pick the top three or so that define the product, and to say explicitly what's out of scope. For a Twitter-like product:
- Users can post a short message.
- Users can follow other users.
- Users can see a feed of messages from the people they follow.
- Out of scope: direct messages, ads, search, trends, media upload.
For an infrastructure problem, like a distributed cache, the "users" are client programs:
- Clients can set a key with a value and an optional expiry.
- Clients can get a key.
- Clients can delete a key.
A long feature list hurts. Every requirement you write down is one you've committed to designing for, and a design that half-covers ten features is worse than one that fully covers three. Ask targeted questions the way you'd interview a product manager: "Does the system need to support editing posts?" "What happens if the driver cancels?" Use the answers to prioritise, not to grow the list.
Non-functional requirements (NFRs) are the qualities the system must have: "the system should be…" statements. They drive most architectural decisions, so they must be specific to this system and quantified wherever possible. "Low latency" is meaningless, because every system wants that. "Feed loads in under 200 ms at p99" identifies which operation needs to be fast and how fast. A checklist to scan, from which you pick the 3–5 that matter most:
| Quality | Question to ask | Example of a useful answer |
|---|---|---|
| Consistency vs availability | During a network partition, is it worse to show stale data or to show an error? | "Booking a seat must be strongly consistent; showing the seat map can be stale by a few seconds." |
| Scale | How many users, requests and how much data? Is traffic bursty? Read- or write-heavy? | "100M daily active users, 100:1 read to write, 10× spikes during live events." |
| Latency | Which operations are user-facing, and what's the budget? | "Search returns in under 500 ms at p99." |
| Durability | What does losing data cost? | "Payments: zero loss. View counts: losing a few minutes is acceptable." |
| Availability | How much downtime is acceptable? | "99.95% for the read path; writes can degrade." |
| Environment | Any device, network or hardware constraints? | "Mobile clients on 3G in emerging markets; battery matters." |
| Security and privacy | Who can see what? Is there sensitive data? | "Messages end-to-end encrypted; health data in scope of HIPAA." |
| Compliance | Legal or regulatory obligations? | "EU users' data stays in EU regions (GDPR); 7-year audit retention." |
| Fault tolerance | What failures must the system survive? | "Loss of one availability zone with no user-visible impact." |
| Cost | Is there a budget, or a cost-per-unit target? | "Under $0.002 per notification delivered." |
The primer's version of this step adds questions that sharpen scope: who uses the system, how they use it, how many there are, what the system's inputs and outputs are, how much data it handles, requests per second, and the read-to-write ratio. Those numbers feed directly into step 2.
Write down assumptions. When the answer to a question is unknown (common at work, and normal in interviews), make a reasonable assumption, say it out loud, and write it down: "I'll assume 10M DAU, and each user views their feed about 10 times a day." Written assumptions can be challenged and corrected; unspoken ones silently distort the design.
Separate what's fixed from what's negotiable. At work, some requirements are hard constraints (regulation, a contractual SLA, a launch date tied to a marketing event), while others are preferences someone would trade for a cheaper or faster design. Ask "what would happen if we relaxed this?" A requirement for "real-time" analytics often turns out to mean "within 5 minutes", which changes the design from stream processing to micro-batches.
Step 2: Estimates#
Back-of-the-envelope estimation translates requirements into numbers that size components: average and peak QPS, storage per year, bandwidth, cache memory, number of machines. Back-of-the-Envelope Estimation and Numbers Every Engineer Should Know teach the mechanics.
The key discipline is to estimate only what changes the design. Many candidates compute DAU, QPS and storage up front only to conclude "so it's big", which tells nobody anything. Estimation earns its place when the result decides between two architectures:
- Does it fit on one machine? Designing trending topics for a social network: are there 10,000 distinct topics per hour or 100 million? The first fits in a min-heap on a single server; the second needs sharded counting and approximate data structures (see Probabilistic Data Structures for Big Data).
- Does it fit in memory? A 2 KB user profile × 500M users is 1 TB. That fits in a Redis cluster of a modest size, but not on one node.
- Is write throughput the bottleneck? 50,000 writes per second sustained rules out a single PostgreSQL primary for many schemas, and pushes you toward sharding or a write-optimised store.
- Is fan-out the bottleneck? A celebrity with 50M followers posting once creates 50M feed insertions with fan-out-on-write, which is why hybrid fan-out exists.
- Is bandwidth the bottleneck? 1M concurrent video viewers at 5 Mbps is 5 Tbps, which only a CDN can serve.
A practical approach in both interviews and design docs: state that you'll estimate when a decision depends on it, then do the arithmetic at that point in the design. That keeps estimates attached to the decision they justify, which also makes them easier to review.
Two numbers are almost always worth having: peak QPS for the hottest operation (usually reads), and total data size after a few years (which decides whether you need partitioning at all). Roughly: average QPS = DAU × actions per user per day ÷ 86,400, and peak is typically 2–10× average depending on how bursty the product is.
Step 3: Core entities#
Before drawing anything, list the core entities: the nouns the system stores and the API exchanges. For the Twitter example that's just User, Tweet and Follow. For a ride-sharing app it's Rider, Driver, Ride, Location and maybe Fare. For a ticketing system it's Event, Venue, Seat, Ticket and Booking.
Two questions help you find them:
- Who are the actors? Riders and drivers, buyers and sellers, publishers and subscribers. Are they the same kind of thing with different roles (a user who is sometimes a host and sometimes a guest), or genuinely different?
- What resources do the functional requirements need? Each requirement usually names one or two nouns: "users post tweets", "users follow other users".
Keep it a short list at this stage, not a full schema. You don't yet know what you don't know. As you build the HLD you'll discover new entities (a FeedEntry table for precomputed feeds, a SeatHold for temporary reservations) and the fields each one needs. Add fields when a component actually uses them, not before.
Naming matters more than it seems. A good name (Booking rather than Data2, SeatHold rather than TempLock) makes the rest of the discussion clearer, and naming is one of the places a reviewer or interviewer sees whether you think precisely. See Data Modeling for how entities become tables, documents or keys, and Domain-Driven Design for Service Boundaries for how entities group into bounded contexts in larger systems.
Step 4: API#
Next, define the contract between the system and its clients. For product-style problems, each functional requirement usually becomes one or two endpoints. Defining the API before the architecture forces you to be concrete: an endpoint has inputs, outputs and an owner, so it's much harder to hand-wave.
Pick the protocol quickly, because it's rarely the interesting decision (see API Styles: REST, gRPC, GraphQL and More):
- REST is the default for public and client-facing APIs: resources as plural nouns, HTTP verbs as actions, broad tooling support.
- GraphQL fits when many different clients (web, iOS, Android, partners) need differently shaped data and you want to avoid over-fetching and under-fetching.
- RPC (gRPC) fits internal service-to-service calls where performance, strict schemas and streaming matter.
- Real-time channels (WebSockets, server-sent events) come in addition to the core API when the client needs pushed updates. Design the request/response API first, then add push (see Polling, Long Polling, SSE, WebSockets and Webhooks).
A REST sketch for the Twitter example:
POST /v1/tweets body: { text } -> Tweet
GET /v1/tweets/{tweetId} -> Tweet
POST /v1/follows body: { followeeId } -> 201
GET /v1/feed?cursor=...&limit=50 -> { tweets: Tweet[], nextCursor }Things worth noting even in a sketch:
- The caller's identity comes from authentication, not from the body or path. There's no
userIdinPOST /v1/tweets. The server derives the author from the auth token. Trusting a client-supplied user ID is a classic security hole (see Authentication and Authorization). - Lists are paginated, preferably with a cursor rather than an offset (stable under inserts, efficient on large tables).
- Writes that clients may retry carry an idempotency key, especially anything involving money or side effects (see Idempotency and Safe Retries).
- Version the API (
/v1/) so you can evolve it without breaking old clients, which matters most for mobile apps that update slowly.
For infrastructure problems, the "API" is a library or system interface instead: get(key), set(key, value, ttl), enqueue(message), ack(messageId). Same idea, same rigour. API Design Best Practices covers the details.
Step 5: Data flow (optional)#
Some systems are less about request/response and more about processing: a web crawler, an ETL pipeline, a video transcoding service, an ad-click aggregator. For these, write the high-level sequence of steps as a simple numbered list before drawing components. For a web crawler:
- Take seed URLs from the frontier.
- Fetch the page (respecting robots.txt and per-host rate limits).
- Parse the HTML and extract text and links.
- Deduplicate content and URLs.
- Store the content; add new URLs to the frontier.
- Repeat.
Each step usually becomes a stage in the HLD, often separated by queues so stages scale independently. If your system is a normal CRUD-style product, skip this step; the API already describes the flows.
Step 6: High-level design#
Now draw boxes and arrows: clients, load balancers, services, databases, caches, queues, object storage. The goal is an architecture that satisfies every API call end to end, and nothing more yet.
The most reliable technique is to go through the API one endpoint at a time. For each endpoint, trace the request from the client through each component to the data store and back, and say what state changes along the way. For the Twitter example:
POST /v1/tweets: client → API gateway → Tweet service → insert into thetweetstable. The table needstweet_id,author_id,textandcreated_at; write those fields next to the database box.POST /v1/follows: → Follow service → insert intofollows (follower_id, followee_id), indexed both ways.GET /v1/feed: → Feed service → look up followees → fetch their recent tweets → merge by time → return a page.
Now you have a working, if naive, system. The feed query will be too slow at 100M DAU, but that's fine: it's a deep-dive topic, and you now have something concrete to improve.
Disciplines that keep the HLD useful:
- Keep it simple first. It's tempting to add caches, queues and sharding as you go. Instead, note each one ("this read path will need a cache; I'll come back to it") and keep moving. Layering complexity early is how designs end up incomplete.
- Say what state changes. For each request, name which tables, caches or queues are written. This is what reviewers and interviewers most want to hear, and it exposes consistency problems early.
- Document only the interesting fields. Everyone knows a user has a name and email. Write down the partition key, the index you'll need, the status column that drives a state machine, the version number used for optimistic locking.
- Show the data flow direction. Arrows should mean something consistent, such as "calls" or "publishes to". Label them when it isn't obvious.
- Group components by responsibility. Separate read paths from write paths if their scaling needs differ; this sets up later deep dives on Pattern: Scaling Reads and Pattern: Scaling Writes.
This first-pass HLD is deliberately naive. Every later improvement (a precomputed feed cache, fan-out workers, a celebrity exception) will be a visible, justified change to this picture.
Step 7: Deep dives#
With a working HLD in place, use the remaining effort to harden it. Deep dives come from four sources:
- Non-functional requirements. Go through each NFR from step 1 and show how the design meets it. "100M DAU" leads to horizontal scaling, caching and sharding. "Feed in under 200 ms" leads to a discussion of fan-out-on-write versus fan-out-on-read. "No double-booking" leads to locking or conditional writes.
- Bottlenecks. Find the component that breaks first as load grows: the hot database, the single queue consumer, the celebrity's partition. Choosing the Right Pattern maps common bottlenecks to the patterns that fix them.
- Edge cases and failures. What happens when a dependency is slow, a message is delivered twice, a user retries a payment, a region goes down, two people grab the last ticket at once?
- Probes from reviewers. At work this is the design review; in an interview it's the interviewer's questions. They usually point at the part they consider most important or most fragile.
For each deep dive, follow the same mini-structure: state the problem precisely (with a number, if possible), list two or three options, compare them on the requirements that matter, pick one, and update the diagram. For the Twitter feed:
- Problem: computing the feed on every read means reading recent tweets from up to thousands of followees. At 100M DAU × 10 feed loads a day, that's about 11,500 feed reads per second on average and several times that at peak, each touching many partitions.
- Options: (a) fan-out-on-read with heavy caching; (b) fan-out-on-write into a per-user feed cache; (c) a hybrid: fan-out-on-write for normal users, fan-out-on-read for accounts with millions of followers.
- Choice: the hybrid. Reads become a single cache lookup plus a small merge; write amplification stays bounded because celebrity tweets aren't fanned out.
- Cost: more moving parts (fan-out workers, a feed cache, a celebrity threshold), and feeds are eventually consistent, typically by a few seconds.
How proactive you are in choosing deep dives depends on seniority. Junior engineers can expect a reviewer or interviewer to point out weak spots. Senior engineers should find them first and lead the discussion, while leaving room for questions. A common mistake is to talk continuously through the deep dives and never let the other person steer. The reviewer usually has a specific concern, and you'll miss it if you don't give them space to raise it.
Step 8: Trade-offs#
Every design decision has a cost. A trade-off statement makes it explicit, in a form that someone can challenge:
"We chose X over Y because requirement R matters more than property P for this system. The cost is C, which we accept because reason. If condition changes, we'd revisit."
For example: "We chose fan-out-on-write over fan-out-on-read because feed latency (p99 under 200 ms) matters more than write cost. The cost is write amplification and a few seconds of feed staleness, which we accept because users don't notice a 3-second delay in seeing a new tweet. If average follower counts grow tenfold, we'd revisit the celebrity threshold."
The recurring trade-off axes are covered in Core System Design Trade-offs: consistency versus availability, latency versus consistency (PACELC), read versus write optimisation, normalisation versus denormalisation, synchronous versus asynchronous, build versus buy, simplicity versus flexibility, cost versus performance. Practise naming which axis each of your decisions sits on.
Two habits make trade-off discussions much stronger:
- Tie each trade-off back to a requirement. "Cassandra is more scalable" is an opinion. "We need 200,000 writes per second across three regions with a tolerance for eventual consistency, which fits Cassandra's model better than a single-primary relational database" is an argument.
- Admit the weaknesses of your own choice. Saying what's bad about the option you picked shows you understand it; pretending it has no downside suggests you don't.
Step 9: Evolution#
A design is a snapshot. The final step asks how it changes over time:
- What breaks at 10×? Identify the next bottleneck after the one you just fixed. Design comfortably for roughly 10× current load, not 1,000×. Over-designing for scale you may never reach costs complexity today, while 10× headroom lets you grow without re-architecture while you learn what users actually do.
- What's the build order? Which parts ship first as a minimum viable version, and which come later? A real design often starts as a modular monolith with one database and splits services only when team or scaling pressures demand it (see Monolith vs Microservices).
- How will it migrate? If this design replaces an existing system, how does traffic move: dual writes, backfills, shadow reads, a strangler-fig cutover? (See Online Data Migrations and Schema Evolution.)
- What would make you change your mind? Name the signals: "If writes exceed 30,000 per second, we'd shard by user ID." "If more than 5% of feed reads miss the cache, we'd revisit TTLs." These signals turn into dashboards and alerts, and into triggers for the next design review.
Communicating the design: levels of zoom#
Designs fail in review when the audience gets the wrong level of detail: executives buried in queue configuration, or engineers given only a marketing diagram. Simon Brown's C4 model offers a useful vocabulary of four zoom levels:
- System context: the system as one box, with its users and the external systems it talks to.
- Containers: the deployable units (web app, API service, database, queue) and how they communicate. This is roughly what "high-level design" means in this handbook.
- Components: the major parts inside one container.
- Code: classes and functions. This is rarely worth drawing by hand.
Most design docs need levels 1 and 2 for everything, and level 3 only for the part under deep discussion. Add sequence diagrams for important flows (especially ones involving retries, failures or several services), and an entity-relationship diagram or key-design table for the data model. Every case study in this handbook uses this combination.
Real-world design versus interview design#
The nine steps are the same at work and in an interview, but almost everything around them differs. An interview compresses design into 45 minutes on a clean slate with one stakeholder. Real design takes days to months, inside an organisation, on top of systems that already exist.
| Dimension | Interview | Real world |
|---|---|---|
| Starting point | Greenfield: nothing exists | Usually brownfield: existing services, data and contracts you can't break |
| Time | 35–60 minutes | Days to months; spikes and prototypes are allowed |
| Requirements | Agreed in about 5 minutes with the interviewer | Negotiated with product, legal, security, finance and other teams; they change during the project |
| Scale numbers | Assumed ("100M DAU") | Measured from production, forecast with error bars, and often smaller than interview numbers |
| Technology choice | Any well-known technology | Constrained by what the company already runs, supports, has licences for and can staff |
| Team | You alone | Several teams; Conway's law shapes the boundaries |
| Cost | Mentioned briefly, if at all | Often a first-class requirement with a budget and a cost review |
| Operations | "Add monitoring" | On-call, runbooks, SLOs, dashboards, capacity plans, upgrade paths |
| Migration | Rarely discussed | Frequently the hardest part: dual-running, backfills, cutover, rollback |
| Output | A whiteboard diagram | A design doc, ADRs, diagrams, a review sign-off, and a project plan |
| Evaluation | Rubric: navigation, design, depth, communication | Whether the system works, is operable, stays within budget, and can evolve over years |
| Failure cost | No offer | Outages, data loss, wasted quarters |
Some consequences are worth spelling out.
Real requirements come from many stakeholders. The product manager wants features, the security team wants a threat model, legal wants data residency, finance wants a cost ceiling, the SRE team wants SLOs and on-call load under control, and the teams who own neighbouring systems want their APIs left alone. A real design doc lists these stakeholders and records which requirements came from whom, because conflicting requirements must be resolved by people, not by architecture.
Existing systems dominate. Most real design is incremental: add a capability to a system that's already running. The questions shift from "which database should we use?" to "can our existing PostgreSQL cluster handle this, and what's the cost of adding a second datastore that the team must learn and operate?" Dan McKinley's essay Choose Boring Technology (2015) frames this as a limited budget of "innovation tokens": each new, unfamiliar technology spends one, so spend them only where they buy something essential.
Smaller numbers are normal. Interview problems assume Twitter-scale traffic. Most production systems serve hundreds or thousands of requests per second, not millions. A single well-tuned PostgreSQL instance and a handful of stateless application servers handle far more load than many teams expect. Recognising when one machine is enough (see Numbers Every Engineer Should Know) is one of the most valuable real-world skills, and it's under-practised because interviews rarely reward it.
Operability is part of the design. A design that works but needs three engineers to babysit it is a bad design. Real designs specify SLOs, dashboards, alerts, runbooks and a production readiness review before launch (see DevOps, SRE and Platform Engineering and Observability: Logs, Metrics and Traces).
Uncertainty can be bought down. In an interview you reason from known numbers. At work you can run a spike: a time-boxed prototype that answers one question ("can DynamoDB give us under 10 ms p99 for this access pattern?" "how big is the index on real data?"). You can also run a load test before committing (see Capacity Planning and Load Testing). A day of measurement often settles an argument that a week of debate wouldn't.
What carries over from interviews. Structure, prioritisation, quantified NFRs, endpoint-by-endpoint HLD, explicit trade-offs and the habit of naming the next bottleneck are exactly what good senior engineers do at work. Interview practice is good training for real design; it's just not the whole job.
The design document
At most technology companies, significant designs are written up as a design doc (also called an RFC, technical spec or engineering proposal) before implementation starts. Malte Ubl's widely read essay Design Docs at Google describes the role these documents play there: informal, written early, reviewed by peers, and primarily a tool for finding problems while change is still cheap. Amazon is known for prose narratives instead of slide decks, and for its "working backwards" practice of writing a press release and FAQ before building, described by Colin Bryar and Bill Carr in Working Backwards (2021). The names and templates vary, but strong design docs share a structure:
- Context and problem: what's happening, why now, who's affected. Include the numbers.
- Goals and non-goals: what this design will achieve, and, just as important, what it deliberately won't. Non-goals prevent scope creep and settle arguments early.
- Requirements: functional and non-functional, quantified, with their sources.
- Proposed design: context and container diagrams, APIs, data model, key flows as sequence diagrams.
- Alternatives considered: at least two serious options and why they were rejected. A doc without alternatives usually means the author didn't consider any.
- Cross-cutting concerns: security and privacy, reliability and failure modes, observability, cost, compliance, accessibility, internationalisation.
- Migration and rollout: how to get from here to there, how to roll back.
- Risks and open questions: what you're unsure about and how you'll find out.
- Timeline and milestones: what ships first.
Length should match the decision. A one-page doc is fine for a small, reversible change; a major platform migration might need twenty pages. A doc that nobody reads is no better than having none, so lead with the summary and the decision being requested.
Iterating on a design#
No design survives first contact with reality unchanged. Good processes make iteration cheap and deliberate rather than accidental.
Iterate in rounds of increasing fidelity. The first round is a whiteboard sketch that's thrown away in an hour. The second is a design doc draft with the main alternatives. The third is a reviewed doc plus spikes that measure the riskiest assumptions. Each round should resolve the biggest remaining uncertainty, not polish what's already settled.
Find the riskiest assumption and test it first. Ask "what single fact, if wrong, would invalidate this design?" Common answers: an access pattern that the chosen database can't serve efficiently, a dependency's real latency, the true size of a dataset, the actual skew of traffic across keys. Test that fact directly, with a prototype, a query against production data, or a load test, before investing in detailed design.
Decide at the last responsible moment. A Lean software development principle, popularised by Mary and Tom Poppendieck, is to delay irreversible decisions until the point where not deciding would start to remove options or cost money. By then you know more. This doesn't mean procrastinating: two-way-door decisions should be made immediately, and one-way doors should be made deliberately once the information that would change them has been gathered.
Prefer designs that keep options open. Some structural choices make later change cheaper:
- Put an interface in front of a dependency you might replace.
- Publish events rather than calling consumers directly, so new consumers can be added without changing the producer.
- Keep services stateless so they can be scaled or moved.
- Choose partition keys that can be split further later.
Each of these has a cost, so use them where change is likely, not everywhere.
Use fitness functions to keep a design honest. Building Evolutionary Architectures (Neal Ford, Rebecca Parsons and Patrick Kua, 2017) introduced architectural fitness functions: automated checks that a design property still holds as the system evolves. Examples:
- A test that fails if the payments module imports from the marketing module.
- A CI check that p99 latency in a load test stays under budget.
- An alert when a table exceeds the size at which the design assumed it would be sharded.
- A dependency check that blocks new calls to a deprecated service.
They turn design intent into something that's continuously verified rather than remembered.
Architecture decision records (ADRs)#
A design doc describes a whole proposal at a moment in time. An architecture decision record (ADR) captures a single significant decision: what was decided, in what context, and with what consequences. Michael Nygard proposed the format in a 2011 blog post, Documenting Architecture Decisions. It has since been adopted widely, and both AWS and Microsoft publish guidance on using ADRs in their architecture documentation.
The core format is deliberately small:
- Title: a short noun phrase, numbered. "ADR-0007: Use PostgreSQL for the bookings service."
- Status: proposed, accepted, deprecated, or superseded (with a link to the ADR that replaces it).
- Context: the forces at play: requirements, constraints, team skills, numbers. This is the part future readers most need, because it explains why the decision made sense at the time.
- Decision: what we're going to do, in active voice. "We will…"
- Consequences: what becomes easier and what becomes harder, including the negative consequences we're accepting.
Many teams add alternatives considered (with a sentence on why each was rejected) and a review date or trigger ("revisit if write volume exceeds 20,000 per second"). Templates such as MADR (Markdown Architectural Decision Records) formalise these extra sections.
# ADR-0007: Use PostgreSQL for the bookings service
Status: Accepted (2026-03-14). Supersedes: none.
Deciders: bookings team, data platform team.
## Context
- Bookings need multi-row transactions (seat hold + payment record + ledger).
- Peak write load forecast: 1,200 writes/s; 3-year data size about 800 GB.
- The company already operates PostgreSQL with backups, PITR and on-call support.
- Team has deep PostgreSQL experience, none with distributed SQL.
## Decision
We will store bookings in a managed PostgreSQL 16 cluster (primary plus two
replicas across AZs), with SERIALIZABLE isolation for the booking transaction.
## Alternatives considered
- DynamoDB: scales further, but multi-item transactions are limited and the
team would need new tooling; our forecast is well within one primary.
- CockroachDB: multi-region writes we don't need yet; new operational burden.
## Consequences
- Easier: transactions, ad-hoc queries, reuse of existing ops tooling.
- Harder: a single write primary; regional failover takes minutes (RTO 15 min).
- Revisit if sustained writes exceed 10,000/s or multi-region writes become a
requirement.Rules that keep ADRs valuable:
- Immutable once accepted. Don't edit an accepted ADR to reflect a new decision; write a new ADR that supersedes it, and link the two. The log of decisions, including the ones that were later reversed, is the point.
- Stored with the code. Commonly in
docs/adr/in the repository, so they're versioned, reviewed in pull requests, and found by the people changing the code. Tools such as adr-tools (a command-line helper) and Log4brains (which publishes ADRs as a browsable site) support this workflow. - Written when the decision is made, not reconstructed months later. A rough ADR written on the day beats a polished one that never gets written.
- Only for significant decisions. A useful test: would a new engineer joining in a year reasonably ask "why did they do it this way?" If yes, write an ADR. Choices of variable naming don't need one; choice of message broker does.
- Short. One or two pages at most. If it needs more, it's probably a design doc that should produce several ADRs.
Design docs versus ADRs versus RFCs. These overlap, and teams use the names differently, but a common split is:
| Artefact | Scope | Lifespan | Typical length |
|---|---|---|---|
| RFC or proposal | A change that needs broad input, often cross-team | Open for comment, then accepted or rejected | 2–10 pages |
| Design doc | The full design of a system or feature | Accurate at approval; may drift afterwards | 3–20 pages |
| ADR | One decision and its reasoning | Permanent, immutable; superseded rather than edited | Under 2 pages |
A design doc typically produces several ADRs: one for the datastore, one for the messaging choice, one for the consistency model. The design doc may go stale as the system evolves, but the ADR log remains a reliable history of why the system looks the way it does.
Design reviews#
A design review is where peers examine a proposal before it's built, while changing it is still cheap. A good review finds the problems the author couldn't see: an unconsidered failure mode, a dependency's real limits, a simpler alternative, a security gap, a team that will be surprised by the change.
How a review typically runs:
- The author circulates the doc a few days ahead, stating the decision they need ("approve the datastore choice and the migration plan").
- Reviewers comment asynchronously. Most issues should be raised and resolved in writing, where reasoning is visible and preserved.
- A review meeting (30–60 minutes) handles what's still contested. Some teams start with silent reading time so everyone has actually read the doc.
- The outcome is recorded: approved, approved with changes, or needs another round, and follow-up ADRs are written.
Who reviews: people with relevant depth (a database expert for a storage decision), owners of neighbouring systems, an SRE or operations representative, security for anything touching sensitive data or trust boundaries, and at least one person outside the immediate team who can ask naive questions. Many companies have an architecture review group or principal engineers who review designs above a certain size.
A pre-mortem is a powerful review technique. Gary Klein described it in Performing a Project Premortem (Harvard Business Review, 2007). Reviewers imagine the project has already failed badly, a year from now, and each writes down why. Because it legitimises pessimism, people raise concerns they'd otherwise keep to themselves, such as "the migration took nine months instead of two" or "the vendor's rate limits were lower than the docs said".
Reviews have failure modes too. They can become gatekeeping rituals that slow every change, or rubber stamps where nobody reads the doc. Mitigations:
- Scale review effort to the decision's reversibility and blast radius. Two-way doors need a quick peer look, not a committee.
- Time-box the review cycle.
- Focus comments on requirements, risks and alternatives rather than style.
- Make it clear who decides when reviewers disagree, usually the owning team, with escalation for cross-team conflicts.
The design review checklist#
Use this checklist when writing a design, reviewing someone else's, or checking your own interview answer before you finish. Not every item applies to every system, but skipping an item should be a conscious choice.
Problem and requirements
- Is the problem stated with evidence (metrics, incidents, user requests)? Is it clear why now?
- Are goals and non-goals explicit?
- Are functional requirements prioritised, with the top ones clear?
- Are non-functional requirements quantified: latency percentiles, throughput, availability, durability, freshness?
- Are the assumptions written down, and has anyone checked the risky ones?
Scale and capacity
- Are peak load (not just average) and growth over 2–3 years estimated?
- Is the hottest path identified, with its expected QPS and data size?
- Is skew considered: hot keys, celebrity users, popular items, time-of-day peaks?
- Is there headroom for about 10× growth, and is it clear what breaks first?
Data
- Is the data model shown, with keys, indexes and partitioning?
- Is the datastore choice justified by access patterns (see Choosing a Database: A Decision Guide)?
- Is the consistency model clear for each operation? Where is strong consistency required, and where is eventual consistency acceptable?
- Are concurrency and contention handled: double-booking, lost updates, idempotent writes?
- Are retention, deletion (including GDPR erasure), backups and restore covered?
- Is schema evolution planned?
Reliability
- Are single points of failure identified and removed, or accepted explicitly?
- For each dependency: what happens when it's slow or down? Timeouts, retries with backoff, circuit breakers, fallbacks (see Resilience Patterns: Timeouts, Retries and Circuit Breakers)?
- Are retries safe, with idempotency keys?
- Is the failure domain clear: zone, region, cell? Is there a disaster recovery plan with RPO and RTO?
- Is overload handled: rate limits, load shedding, back pressure?
Security and privacy
- Are authentication and authorisation defined for every entry point?
- Is sensitive data classified, encrypted in transit and at rest, and access-logged?
- Are trust boundaries and the threat model documented? Are secrets kept out of code and config?
- Is user input validated? Are SSRF, injection and abuse (spam, scraping) considered?
- Are compliance requirements (GDPR, PCI DSS, HIPAA, data residency) met?
Operability
- Are SLOs defined, with metrics, dashboards and alerts on symptoms?
- Is distributed tracing in place across service boundaries? Are logs structured?
- Are there runbooks for the expected failure modes? Who is on call?
- How are deploys done: canary, feature flags, rollback in minutes?
- Are capacity limits and autoscaling policies defined?
Cost
- Is there a monthly cost estimate at launch and at 10× load? What dominates it: compute, storage, egress, licences?
- Are there cheaper alternatives that meet the requirements, and why weren't they chosen?
- Are there hidden costs: cross-zone traffic, egress, idle capacity, operational headcount?
Evolution and delivery
- Is the migration plan safe and reversible: dual writes, backfill, shadow reads, cutover, rollback?
- Is the rollout incremental, and what's the minimum viable first version?
- Are the decisions recorded as ADRs, with triggers for revisiting them?
- Does team ownership match the architecture? Will any team carry an unreasonable cognitive load?
- Are the alternatives considered real ones, and is the chosen option the simplest that meets the requirements?
The last question deserves emphasis. The most common design-review finding isn't a missing feature but unnecessary complexity: a queue where a synchronous call would do, microservices where one service would do, a custom system where a managed one would do. Ask "what's the simplest design that meets these requirements, and why isn't this it?"
Worked mini example: a restaurant waitlist service#
To see the whole process at once, here's a compressed design for a realistic, moderately sized system. It's deliberately not Twitter-scale, because most real systems aren't, and part of the lesson is not over-building.
The prompt: "Design a waitlist product for restaurants. Hosts add walk-in parties to a list on a tablet. Guests get a text message when their table is ready."
1. Requirements. After clarifying questions with the (imaginary) product manager:
- Functional:
- Hosts can add a party (name, size, phone) to the waitlist.
- Hosts can see the live list and mark a party as notified, seated or removed.
- Guests receive an SMS when the host marks them notified.
- Guests can open a link to see their position and estimated wait.
- Out of scope: reservations, payments, table layout management, reviews.
- Non-functional:
- Updates appear on every host tablet in the restaurant within 2 seconds.
- SMS is sent within 10 seconds of the host's tap, at least 99.9% of the time.
- The host-facing system is available 99.9% of the time during opening hours. A dead waitlist on a Friday night is a disaster for the restaurant.
- Phone numbers are personal data: retained for 30 days at most, then deleted.
- Assumed scale: 5,000 restaurants at launch, aiming for 50,000 in three years.
2. Estimates (only the ones that matter).
- Parties: about 200 per restaurant on a busy day × 5,000 restaurants = 1M parties per day. If about 40% arrive in a two-hour dinner peak, that's 400,000 ÷ 7,200 s ≈ 55 party creations per second, and a similar rate of status changes and SMS sends.
- Guest status checks: about 10 per party is 10M per day, peaking around 550 reads per second.
- Tablets: 2 per restaurant is 10,000 open connections for live updates.
- Storage: about 500 bytes per party × 1M per day ≈ 0.5 GB per day. The 30-day retention caps live data around 15 GB.
The conclusion is the useful part: this fits comfortably on one PostgreSQL primary with a replica, a few stateless application servers, and one modest WebSocket tier. Sharding, Cassandra or Kafka would add cost and operational burden with no benefit. At 10× scale (50,000 restaurants), writes reach about 550 per second, which still fits one well-provisioned primary.
3. Core entities. Restaurant, Host (a staff user), Party (name, size, phone, status, timestamps), Notification (one SMS attempt and its delivery status).
4. API.
POST /v1/restaurants/{rid}/parties { name, size, phone } -> Party
GET /v1/restaurants/{rid}/parties?status=waiting -> Party[]
PATCH /v1/parties/{pid} { status, version } -> Party
GET /v1/guest/{token} -> { position, estimatedWaitMin }
WS /v1/restaurants/{rid}/stream server pushes party changes to tabletsThe guest link uses an unguessable random token rather than the party ID, so guests can't enumerate other parties. Host endpoints derive the restaurant and role from the auth token, and the server checks the host belongs to {rid}. PATCH carries the row's version for optimistic concurrency.
5. Data flow: skipped, because this is a request/response product.
6. High-level design. Walking the endpoints:
- Add party: insert into
parties, then broadcast the change to the restaurant's tablets. - Mark notified: update the status and enqueue an SMS.
- Guest status: read the position from the waiting list, with a 5-second cache.
7. Deep dives. Three are worth the time.
(a) The SMS must really be sent, once. If the API updates the party and then calls the SMS provider directly, a crash between the two loses the message, and a retry after a timeout may send it twice. Instead:
- The status update and an
outboxrow are written in the same database transaction (the outbox pattern; see Change Data Capture and the Outbox Pattern). - A worker reads the outbox and calls the provider with an idempotency key derived from the notification ID.
- It marks the row sent only after the provider accepts.
Provider errors are retried with exponential backoff and jitter. After a few failures, or if provider A's error rate crosses a threshold, the worker switches to provider B. A delivery receipt webhook updates the notification's status, so the host tablet can show "delivered" or "failed: ask at the desk".
(b) Two hosts act on the same party at once. One host taps "seated" while another taps "remove". Optimistic concurrency control resolves it (see Concurrency Control and Database Locking). Each PATCH includes the version it read; the update succeeds only WHERE version = :v. The loser gets a 409 Conflict, and its tablet refreshes to show the current state. Contention is tiny (two tablets per restaurant), so optimistic beats pessimistic locking here.
(c) Live updates to tablets. Each tablet holds a WebSocket to the gateway, subscribed to its restaurant's channel. When the API commits a change, it publishes to a Redis pub/sub channel for that restaurant, and whichever gateway node holds that restaurant's sockets pushes the change. Redis pub/sub is fire-and-forget, so a tablet that reconnects after a Wi-Fi drop asks for "changes since version N" (or reloads the list), which makes missed messages harmless. At 10,000 connections, a pair of gateway nodes is plenty; the second is for redundancy. See Pattern: Pushing Realtime Updates.
8. Trade-offs.
- One PostgreSQL primary versus a distributed store: chosen for transactions (party status and outbox together) and simplicity. The cost is a regional single primary with failover in about a minute, which the 99.9% target tolerates.
- Redis pub/sub versus a durable stream: chosen for simplicity. The cost is possible lost pushes, which we accept because reconnect-and-resync covers them.
- Polling for guests versus pushing to them: guests poll every 15 seconds via the cached endpoint. This is cheaper and simpler than holding hundreds of thousands of guest sockets, and a 15-second staleness on "you are 4th in line" is fine.
9. Evolution.
- At 50,000 restaurants: the single primary still fits, but we'd add read replicas for guest reads and consider partitioning tables by restaurant ID.
- International launch: data residency (EU data in EU regions), per-country SMS providers and sender rules, and localised messages bring in Internationalization and Localization. Running separate regional deployments (cells) would solve both residency and blast radius (see Multi-Tenant SaaS Architecture).
- Watch these signals: writes above about 5,000 per second, SMS provider p99 above 10 seconds, and any single restaurant chain large enough to be a noisy neighbour.
- ADRs to write: ADR-0001 PostgreSQL with outbox; ADR-0002 WebSocket and Redis pub/sub for tablets; ADR-0003 dual SMS providers; ADR-0004 30-day phone-number retention with a nightly deletion job.
That's the whole method in about a page. A real design doc would expand each step, add a cost estimate and threat model, and go through the review checklist above. But the skeleton, and the order of thought, would be the same.
When to Use It#
Use the full process (all nine steps, a written design doc, ADRs and a review) when a decision is expensive to reverse or affects people beyond your team:
- A new system or major component, especially one with persistent data, a public API, or other teams as consumers.
- Choosing or replacing a datastore, message broker, or other core infrastructure. These are one-way doors, often for years.
- Changes to contracts that many clients depend on: API versions, event schemas, shared libraries.
- Cross-team designs, where alignment matters as much as technical correctness.
- Anything with significant cost (say, more than a few engineer-months or a noticeable cloud bill), security sensitivity, or compliance exposure.
- Responses to serious incidents where the fix is architectural rather than a patch.
- System design interviews, where the process is exactly what's being assessed, in compressed form.
Signals that you've skipped the process when you shouldn't have: arguments about the design during code review, a second datastore appearing without anyone deciding to add it, nobody able to explain a past choice, or discovering a requirement (data residency, a latency SLO) after launch.
Pick something else instead when:
- The change is a two-way door. A configuration tweak, an internal refactor or a feature behind a flag is easy to undo. Write a pull request description and move on.
- You're exploring. For a prototype or proof of concept, the "design" is the experiment. Write down the question it answers, build it quickly, and write the design doc after you've learned what works, if it's going to production.
- The answer is already standard. If the platform has a golden path for "new stateless service with PostgreSQL", follow it. Record an ADR only for deviations.
When NOT to Use It#
- Don't turn the process into bureaucracy. If every small change needs a design doc, a review meeting and a sign-off, people will either stop making improvements or route around the process. Scale the ceremony to the risk.
- Don't follow the steps mechanically in an interview when the problem doesn't fit. For an infrastructure problem with no product API, step 4 becomes a library interface. For a pure data pipeline, the data flow (step 5) matters more than the API. Adapt the method to the problem.
- Don't use the process to defer decisions indefinitely. "We need more analysis" can become a way to avoid committing. Time-box design work, and make the decision when the remaining uncertainty can only be resolved by building.
- Don't write ADRs for decisions you haven't really made. An ADR that records "we'll use Kafka" when nobody has evaluated alternatives just launders an assumption.
How to Implement It#
How to introduce this process in a team or organisation:
- Agree on what needs a design doc. Write a short threshold: new services, new datastores, public API changes, cross-team dependencies, and anything over a size or cost limit. Everything else uses a pull request description.
- Publish a lightweight template (below) and one or two good example docs. Examples teach more than templates.
- Create an ADR directory in each repository (
docs/adr/), with ADR-0001 recording the decision to use ADRs. Number ADRs sequentially and never reuse numbers. - Set up a review path. Name who reviews which kinds of designs, where docs are posted, and a default review window (for example, five working days). Make it clear who has the final say.
- Include the cross-cutting reviewers early: security, SRE or operations, data privacy. Late discovery of their concerns is the most expensive kind.
- Link designs to delivery. The project plan references the design doc; pull requests reference ADRs where relevant; the production readiness review checks the design's SLOs and runbooks exist.
- Revisit decisions on triggers. When a revisit condition in an ADR fires (load, cost, a new requirement), start a new mini-cycle that ends in a superseding ADR.
- Keep it alive. Periodically check that docs are being written and read, that reviews take days rather than weeks, and that engineers find the process useful. Trim what doesn't help.
A design doc skeleton that works for most teams:
# <System or feature name>: design
Author(s): ... Reviewers: ... Status: Draft | In review | Approved
Decision needed: <one sentence: what reviewers are asked to approve>
## 1. Context and problem (evidence, numbers, why now)
## 2. Goals / Non-goals
## 3. Requirements
- Functional (prioritised)
- Non-functional (quantified: p99 latency, QPS, availability, RPO/RTO)
- Assumptions and open questions
## 4. Proposed design
- Context diagram, container diagram
- API sketch
- Data model (keys, indexes, partitioning, retention)
- Key flows (sequence diagrams, incl. failure paths)
## 5. Alternatives considered (at least two, with reasons rejected)
## 6. Cross-cutting concerns
- Security & privacy (threat model, data classification)
- Reliability (failure modes, SLOs, DR)
- Observability (metrics, alerts, dashboards, runbooks)
- Cost (launch and 10x estimate)
## 7. Rollout and migration (phases, feature flags, rollback plan)
## 8. Risks and mitigations
## 9. Milestones
## Appendix: estimates, benchmark results, ADRs producedTools that help:
| Technology | Fits when |
|---|---|
| Google Docs, Confluence, Notion | Collaborative design docs with inline comments; easy for non-engineers to review |
| Markdown in the repository (pull-request reviewed) | Engineering-only audiences; docs versioned next to the code they describe |
| adr-tools, Log4brains, MADR templates | Managing ADRs as numbered Markdown files, with a browsable site in Log4brains |
| Mermaid, PlantUML | Diagrams as text: versioned, diffable, rendered in docs and repositories |
| Structurizr (C4 model) | Larger systems where you want one model rendered at several zoom levels |
| Excalidraw, draw.io (diagrams.net), Miro | Fast whiteboard-style sketches for early rounds and interview practice |
| Backstage TechDocs | Publishing docs and ADRs alongside each service in an internal developer portal |
Trade-offs#
| Option | Pros | Cons | Pick when |
|---|---|---|---|
| Big design up front (detailed doc before any code) | Finds expensive problems early; good alignment across teams | Slow; guesses can be wrong; can produce stale docs | Decisions are irreversible, cross-team, or regulated |
| Lightweight doc plus spikes | Balances thinking and learning; risky assumptions get tested | Needs discipline to time-box spikes | Most new systems and major features |
| Emergent design (just build, refactor later) | Fast; learns from reality | Accidental one-way doors; no recorded reasoning | Prototypes, small two-way-door changes |
| ADRs only, no design doc | Very low overhead; permanent decision history | No holistic view of the system | Incremental changes to existing systems |
| Synchronous review meetings | Fast resolution of contested points; shared context | Expensive; biased toward the loudest voices | Contested or high-stakes designs |
| Asynchronous written review | Inclusive across time zones; reasoning is preserved | Can drag on; comments without resolution | The default for most designs |
Common Pitfalls#
- Jumping to solutions. Naming technologies before the requirements are agreed. "We'll use Kafka" in the first five minutes is a red flag in both interviews and design docs.
- Unquantified non-functional requirements. "Scalable, highly available, low latency" describes every system and constrains none.
- Estimating everything, using nothing. Pages of arithmetic that don't change any decision.
- Designing for imagined scale. Building for 1,000× growth that never arrives, at the cost of complexity today.
- Skipping the API. Without a concrete contract, the HLD floats free of the requirements.
- Adding complexity during the HLD. Caches and queues everywhere before a basic end-to-end path exists.
- Ignoring failure paths. Designs that only describe the happy path.
- No alternatives. A design doc with only one option hasn't been designed; it's been asserted.
- Hiding the weaknesses. Reviewers find them anyway, and trust drops.
- Never writing decisions down, or writing them so long after the fact that the real reasons are forgotten.
- Editing accepted ADRs instead of superseding them, which destroys the history.
- Process theatre. Docs written to satisfy a gate, not to think. If nobody changes their mind because of a review, ask whether the review is doing anything.
Real-World Examples#
-
Google design docs. Design docs are a long-standing part of engineering culture at Google, as described in Malte Ubl's essay Design Docs at Google and in Software Engineering at Google (Winters, Manshreck and Wright, 2020). They're written before significant implementation, emphasise trade-offs and alternatives, and are reviewed by peers. Their main value is finding problems early and spreading context.
-
Amazon narratives and working backwards. Amazon replaced slide decks in senior meetings with six-page prose narratives, read silently at the start of the meeting. For new products, teams write a press release and FAQ ("PR/FAQ") first, to force clarity on the customer problem before any design. Both are described in Bryar and Carr's Working Backwards. The same letter that introduced Type 1 and Type 2 decisions explains why Amazon tries to push reversible decisions down to small teams.
-
ADRs in industry. Michael Nygard's 2011 format is now recommended in AWS Prescriptive Guidance and Microsoft's Azure architecture guidance. Spotify's engineering blog has described when its teams write ADRs, and the format is common in open-source projects.
-
Open-source design processes. Large open-source projects run public versions of design review:
- Python Enhancement Proposals (PEPs), with PEP 1 describing the process.
- Rust's RFC process, used for language and library changes.
- Kubernetes Enhancement Proposals (KEPs), which track each feature from proposal through alpha, beta and general availability.
- The IETF's Request for Comments series, which has documented internet protocol designs since RFC 1 in 1969.
They're excellent free examples of motivation, alternatives, and decisions recorded alongside rejected options.
-
Production readiness reviews. Google's SRE practice of reviewing a service's design and operability before SREs take on its pager (described in Site Reliability Engineering, 2016) is a design review focused on operations: monitoring, capacity, failure modes and emergency response.
-
Pre-mortems. Klein's pre-mortem technique has been adopted in project planning far beyond software, because it consistently surfaces risks that conventional reviews miss.
Case studies that use this pattern#
Every case study in this handbook follows the same nine-step process. These show it particularly clearly:
- Design a URL Shortener (Bitly): a compact example where estimates (ID space, read-to-write ratio) directly drive the design.
- Design a News Feed (Facebook / Twitter): the deep-dive progression from a naive HLD to hybrid fan-out, as used on this page.
- Design a Ticket Booking System (Ticketmaster): non-functional requirements that differ per operation (consistent booking, available browsing).
- Design a Web Crawler: where the optional data-flow step shapes the whole architecture.
- Design a Payment System: correctness, idempotency and auditability as first-class requirements.
- Design a Chat System (WhatsApp): real-time connections, delivery guarantees and evolution to global scale.
In the Interview#
Common follow-ups:
- "How would you approach this if you joined a team that already runs a system for this?" Start from measurements of the current system and the actual pain points. Prefer incremental change with a migration plan over a rewrite, and record decisions as ADRs.
- "What would you do differently if traffic were 100× smaller?" Simplify: one database, a monolith or a few services, managed services everywhere. Say explicitly which components you'd drop and why.
- "What's the riskiest part of your design?" Name it honestly, say how you'd test it early (spike, load test, prototype), and give a fallback plan.
- "How do you decide what to write down?" Write down one-way-door decisions, cross-team contracts, and anything a future engineer would ask "why?" about. Keep each ADR short and immutable.
- "When is a design over-engineered?" When it solves problems the requirements don't have, at a cost in complexity, money or operations. The test is whether each component traces back to a requirement.
Deep Dive: Deciding Under Uncertainty: Reversibility, Option Value and the Value of a SpikeShow
Design is decision-making with incomplete information. A few ideas from decision theory and product-development economics make the process sharper.
Classify decisions on two axes. Impact (how much it matters if you're wrong) and reversibility (how expensive it is to change later). The resulting 2×2 tells you how much process a decision deserves:
| Easy to reverse | Hard to reverse | |
|---|---|---|
| Low impact | Decide instantly; the individual engineer chooses | Decide quickly, but write a short ADR |
| High impact | Decide quickly, measure, adjust (feature flags, canaries) | Full process: alternatives, spikes, design doc, review |
Much of good architecture is moving decisions into the left column. Feature flags make launches reversible. An abstraction layer over a vendor makes switching cheaper. Expand-and-contract schema changes make migrations reversible. Dual writes make a datastore switch reversible until the old store is turned off. Each of these costs something, so it's worth paying only for high-impact decisions.
The value of information. A spike or prototype is worth running when the expected cost it avoids exceeds its own cost. A worked example:
- You're choosing between two datastores. You estimate a 30% chance the leading option can't meet the latency target on your real access pattern.
- If that's discovered after launch, the migration costs about 6 engineer-months.
- A spike that would reveal the problem with high confidence takes 1 engineer-week, about 0.25 engineer-months.
- Expected cost avoided ≈ 0.3 × 6 = 1.8 engineer-months, against a cost of 0.25, so the spike is clearly worth it.
Now change one number. If you were 95% confident (a 5% chance of failure), the expected cost avoided is 0.3 engineer-months, roughly break-even. Spikes are most valuable precisely where the team is most uncertain, which is also where people are most tempted to argue rather than measure.
Options are worth more when uncertainty is high. Real-options thinking, borrowed from finance, says that the right to make a decision later has value, and that value grows with uncertainty. A design that keeps an option open (for example, a partition key that allows later splitting, or an event log that allows new consumers) is like buying an option. It costs a premium now, but it pays off if the future goes a certain way. When the future is predictable (a well-understood CRUD app), options are cheap to skip. When it's highly uncertain (a new product category), they're worth buying.
Cost of delay. Reinertsen's The Principles of Product Development Flow (2009) argues that teams should put a number on how much each week of delay costs: lost revenue, a missed market window, or ongoing incident costs. Without that number, teams tend to over-invest in analysis, because the cost of delay is invisible while the risk of a wrong decision feels vivid. If a feature is worth $50,000 a week, two extra weeks of design review cost $100,000, so the review needs to be finding problems at least that expensive.
Cognitive biases that show up in design.
- Anchoring. The first architecture proposed shapes every later discussion. Ask for independent alternatives before discussing any one option.
- Sunk cost. "We've already spent three months on this approach" isn't a reason to continue. Only future costs and benefits matter.
- Familiarity bias. Teams choose what they know. This is often correct (operational expertise is a real benefit), but it should be stated as a reason rather than disguised as a technical argument.
- Novelty bias. The opposite failure: new technology chosen for interest rather than need. "Choose boring technology" exists as a counterweight.
- Groupthink. Reviews where nobody wants to challenge a senior author. Pre-mortems, written async comments and explicitly asking quieter reviewers counteract it.
Disagree and commit. Not every design debate reaches consensus. A healthy process has a clear decider and a norm that, once a decision is made with dissent recorded, everyone commits to making it work. The ADR's context and consequences sections are the right place to record the dissenting view, so that if the trade-off later goes badly, the team can learn rather than blame.
Deep Dive: Formal Architecture Evaluation: Quality-Attribute Scenarios, ATAM and Risk StormingShow
Most design reviews are informal. For large or high-stakes systems, the software architecture research community has developed more structured methods. They're worth knowing because their core ideas improve even an informal review.
Quality-attribute scenarios. In Software Architecture in Practice, Len Bass, Paul Clements and Rick Kazman (of the Software Engineering Institute at Carnegie Mellon) argue that a vague quality like "available" or "modifiable" should be written as a concrete scenario with six parts:
| Part | Meaning | Example |
|---|---|---|
| Source | Who or what causes the event | An availability zone |
| Stimulus | What happens | Loses power |
| Artefact | Which part of the system is affected | The booking service and its database primary |
| Environment | Under what conditions | Normal operation, Friday evening peak |
| Response | What the system does | Fails over to the replica in another zone; in-flight requests are retried |
| Response measure | How we measure success | No booking lost; under 60 s of elevated errors; p99 under 1 s within 2 minutes |
This is exactly the "quantify your NFRs" advice, made rigorous. A scenario is testable: you can run a game day that kills a zone and check the response measure. The same structure works for non-runtime qualities. Modifiability: "A developer adds a new payment method; the change touches at most two services and ships in under two weeks."
ATAM. The Architecture Tradeoff Analysis Method, developed at the SEI by Kazman, Klein and Clements around 2000, is a structured evaluation run with stakeholders over a few days. Its key steps:
- Present the business drivers and the architecture.
- Build a utility tree: a hierarchy from broad qualities (performance, availability, security) down to concrete scenarios. Each scenario is rated by importance to the business and difficulty to achieve (high, medium or low).
- Analyse the architecture against the highest-rated scenarios, identifying:
- Sensitivity points: design decisions that strongly affect one quality, such as replica count affecting availability.
- Trade-off points: decisions that affect several qualities in opposite directions, such as synchronous replication improving durability while hurting write latency.
- Risks and non-risks: decisions that may cause problems, and those confirmed to be fine.
- Group the risks into risk themes and connect them back to business drivers.
Full ATAM is heavyweight and uncommon in fast-moving product companies. But its vocabulary is useful in any review: "replication mode is a trade-off point between durability and write latency" is a precise, reviewable statement. The high-importance, high-difficulty scenarios are where deep dives belong, in interviews too.
Lightweight alternatives.
- Risk storming (Simon Brown): each participant independently marks risks on the architecture diagram (likelihood × impact), then the group converges. Independent marking avoids anchoring, and it fits in an hour.
- Threat modelling with STRIDE (Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege), a mnemonic that originated at Microsoft: walk each data flow across a trust boundary and ask which of the six threats apply. It's the security equivalent of quality-attribute scenarios. See Security Fundamentals for System Design.
- Failure mode and effects analysis (FMEA): for each component, list how it can fail, the effect, how it's detected, and the mitigation. It's borrowed from reliability engineering and produces a table that maps directly to runbooks and alerts.
- Architecture katas (Ted Neward): practice exercises where small groups design a system for a short brief and present the trade-offs. These are close to interview practice and good for building the skill.
Fitness functions close the loop. Evaluations happen once; systems keep changing. Turning the key scenarios into automated checks (load tests in CI for performance scenarios, chaos experiments for availability scenarios, dependency rules for modifiability scenarios) keeps the evaluated properties true after the review is over.
Deep Dive: From Numbers to Architecture: Thresholds That Force a Design ChangeShow
Estimates matter because certain thresholds force architectural change. Knowing roughly where they lie lets you skip complexity below them and plan for it above them. The figures below are rough planning ranges for modern hardware and common configurations. Real limits depend heavily on data shape, query complexity and tuning, so validate them with a load test before committing (see Numbers Every Engineer Should Know).
| Dimension | Roughly fine on a simple design | Starts to force change | Typical change |
|---|---|---|---|
| Relational writes | Up to thousands of simple writes per second on one primary | Sustained tens of thousands per second, or hot rows | Batching, write-optimised store, sharding by a high-cardinality key |
| Relational reads | Tens of thousands of simple indexed reads per second with replicas | Read load beyond what a few replicas and a cache absorb | Cache-aside, more replicas, denormalised read models |
| Data size | Hundreds of GB to a few TB on one node | Many TB, or indexes that no longer fit in memory | Partitioning, archiving cold data, tiered storage |
| Cache | One Redis node: on the order of 100,000 simple operations per second | Memory or throughput beyond a node; hot keys | Redis Cluster, client-side caching, key replication for hot keys |
| Concurrent connections | Tens of thousands per server easily; hundreds of thousands with tuning | Millions of concurrent users | A dedicated connection tier, pub/sub fan-out between nodes |
| Fan-out per event | Hundreds to thousands of recipients | Millions of recipients (celebrities, broadcasts) | Hybrid fan-out, pull for large accounts, CDN-style broadcast |
| Latency budget | Several hundred ms allows a few sequential service calls | A tight budget (under about 100 ms) with cross-region hops | Precomputation, co-location, parallel calls, edge caching |
| Geography | One region serves a single continent well | Users across continents, or data residency rules | Regional read replicas, CDN, multi-region or cell architecture |
Two lessons follow.
Most products live entirely in the left column for years. The restaurant waitlist at 50,000 restaurants still needs only one primary database. Many SaaS products with millions of users never leave a single relational cluster with replicas and a cache. Interview problems are deliberately chosen to cross these thresholds, which can give a distorted sense of what's normal.
Crossing one threshold doesn't mean crossing all of them. A system may need a sharded write path but a simple, cached read path, or a global CDN for static assets while keeping a single-region database. Good designs apply complexity locally, at the component that crossed the threshold, rather than globally.
A worked progression for the waitlist service shows how the thresholds drive evolution:
- Launch (5,000 restaurants): about 55 writes per second at peak and 10,000 sockets. One PostgreSQL primary plus a replica, two app servers, two WebSocket nodes.
- 10× (50,000 restaurants): about 550 writes per second and 100,000 sockets. Same database, now with a replica serving guest reads; four to six WebSocket nodes. The busiest hour of the busiest day is load-tested.
- 100× (500,000 restaurants, global): about 5,500 writes per second and a million sockets, across continents with data residency rules. Now the geography threshold is crossed before the write threshold. The natural design is regional cells, each a copy of the launch architecture serving a set of countries, with a small global directory that maps restaurants to cells. Each cell stays comfortably in the left column, and a failure in one cell affects only its region.
The 100× design isn't a rewrite of the launch design: it's the launch design, repeated. Choosing structures that scale by replication (stateless services, data partitioned by a natural tenant key) is what made that possible, and it's the payoff of thinking about evolution in step 9.
Key Takeaways#
- System design is a sequence of decisions under uncertainty. The process makes them in a sensible order and makes the reasoning visible.
- The nine steps: requirements → estimates → core entities → API → data flow (optional) → high-level design → deep dives → trade-offs → evolution. They're iterative, not a waterfall.
- Pick the top three functional requirements, name what's out of scope, and quantify 3–5 non-functional requirements. These drive everything else.
- Estimate only what changes the design: fits on one machine or not, fits in memory or not, write throughput, fan-out, bandwidth.
- Build the HLD one API endpoint at a time, saying what state changes. Deliver a simple working system before adding complexity, and note optimisations for the deep dives.
- In deep dives: state the problem with a number, compare two or three options, pick one, update the diagram, and state the trade-off tied to a requirement.
- Real-world design adds stakeholders, existing systems, cost, operability and migration. Most real systems are far smaller than interview problems, and recognising when one machine is enough is a key skill.
- Use design docs for whole proposals and ADRs (context, decision, consequences; immutable, superseded rather than edited) for individual significant decisions, stored with the code.
- Run design reviews scaled to each decision's reversibility and impact, with a checklist covering requirements, scale, data, reliability, security, operability, cost and evolution. Pre-mortems surface hidden risks.
- Treat one-way and two-way doors differently. Buy information with spikes when uncertainty is high, and prefer structures that keep options open where change is likely.