System Design Method
Every topic playbook applies this lens. Read it before any single design.
System design is a chain of decisions under constraint: what to ingest, what to store, what to compute, what to serve. Each stage cuts waste and keeps signal. The best design chooses well what to do, and does no more.
The shape of any system
Almost every nontrivial system has four capabilities.
| Capability | Search engine example | General |
|---|---|---|
| Discover / ingest | crawler | get data in (API, events, uploads, crawl) |
| Understand / model | parser, extractor | parse, validate, enrich, normalize |
| Organize | inverted index | store for efficient query (index, schema, partition) |
| Serve | query path | answer requests under a latency budget |
Two support planes sit beside them. The metadata and policy plane holds rules, scheduling, dedup, config, and quotas. The observability and control plane holds metrics, debugging, replay, backfill, and allow and block lists.
The three pillars (Kleppmann, DDIA)
Score every design against reliability, scalability, and maintainability. They are the non-functional spine.
Reliability means the system works correctly under hardware failure, software bugs, and human error. Werner Vogels: "everything fails all the time". The tools are Nygard's stability patterns: timeouts, retries with exponential backoff, circuit breakers, bulkheads, idempotency. A reliable system assumes its dependencies fail and degrades on purpose.
Scalability means handling growth in load. Define load parameters first (QPS, payload size, fan-out, read/write ratio), then describe performance under that load (p50, p95, p99, throughput). Prefer horizontal scaling and partition by a key that avoids hot spots. A scalability claim is the answer to "if load grows by X, what is the plan".
Maintainability means operable, simple, evolvable. Ousterhout's A Philosophy of Software Design asks for deep modules: simple interfaces over significant implementation. Complexity accumulates in dependencies and obscurity. Observability belongs in the design from the start.
Numbers every engineer should know (Jeff Dean)
Use these for back-of-envelope math. They are orders of magnitude.
| Operation | Time |
|---|---|
| L1 cache reference | ~1 ns |
| Branch mispredict | ~5 ns |
| Main memory reference | ~100 ns |
| Compress 1 KB | ~2 us |
| SSD random read | ~16 us |
| Read 1 MB sequentially from memory | ~10 us |
| Read 1 MB sequentially from SSD | ~50 us |
| Round trip within same datacenter | ~0.5 ms |
| Read 1 MB sequentially from disk | ~5 ms |
| Disk seek | ~2 ms |
| Round trip CA to Netherlands | ~150 ms |
Always show the sizing math. If you cannot do it, you do not understand the scale yet.
QPS = DAU x actions/day / 86400
peak QPS = avg x (2 to 10)
storage = records x bytes/record x replication x retention
bandwidth = QPS x payload
The 13-stage method
A System Design Doc walks these stages, and the template mirrors them.
| Stage | What it covers |
|---|---|
| 1. Problem and context | One-line frame: who, scale, internal or web-scale. |
| 2. Requirements | Functional, plus non-functional with numbers: latency SLO, throughput, availability, consistency model, cost ceiling. |
| 3. Mental model | End-to-end flow as a mermaid diagram. See the whole path before any component. |
| 4. High-level architecture | Components, mermaid, and the two support planes. |
| 5. Deep dives | The 2 or 3 components that carry the risk: data structures, algorithm, hard trade-off. Staff work separates from senior here. |
| 6. Data and storage | Separate stores by function and access pattern: KV or wide-column for random updates, object storage for blobs, search index for text, relational for transactions. Favor immutability (Helland: events over mutable state). |
| 7. Scale and partitioning | Sharding, replication, rebalancing. Owner-per-partition for coordination. Stateless workers autoscale; stateful ones need leadership and replicas. |
| 8. Consistency and failure | Pick a consistency model honestly (eventual is fine if it converges). Enumerate failure modes, how the design resists each, and what breaks first. |
| 9. Observability and ops | Metrics per stage, plus the debugging tools that must exist: inspect one record's lifecycle, explain one request's result. |
| 10. Security and compliance | Store the least data, sandbox untrusted input, sanitize parsing, respect external policy. |
| 11. Incremental plan | Vertical slice first on small scope with proven engines, then efficiency and quality, then real scale, then advanced. |
| 12. Trade-offs | Coverage vs quality, freshness vs cost, recall vs latency, complexity vs delivery speed, centralize vs partition. |
| 13. Open questions | What a design reviewer should interrogate. |
Trade-off discipline
Never present one option as obvious. Name the alternative, the axis, and the choice:
Chose X over Y because {axis} matters more here, given {constraint}.
A design with no stated trade-off hid one.
Build pragmatically
Use a proven engine (Lucene, Postgres, Kafka, a managed queue) for the layer full of treacherous detail, and spend your quarters on the pipeline and logic that are your edge. Reinvent only the part that is the product.
Consistency, time, and ordering
Lamport's Time, Clocks, and the Ordering of Events in a Distributed System (1978) is the root of distributed reasoning. A distributed system has no single global "now", so you reason about causal ordering instead of wall-clock ordering. This underlies eventual consistency and vector clocks, and it is why relying on timestamps is a trap (clock skew).
Helland's Life Beyond Distributed Transactions draws the practical conclusion. At scale you give up cross-entity ACID and design around independent, idempotent units that reconcile eventually.
CAP and PACELC
Under a network partition (P) you choose availability (A) or consistency (C): Brewer's CAP. PACELC adds that else (E), with no partition, you trade latency (L) against consistency (C). Most real designs are AP under partition and trade latency for consistency in normal operation. Say which corner you sit in and why, per operation rather than per system.
The canon
Cite these when they sharpen a point.
| Person | Idea | Source |
|---|---|---|
| Martin Kleppmann | reliability/scalability/maintainability; load params before perf | DDIA (2017) |
| Jeff Dean, Sanjay Ghemawat | numbers everyone knows; MapReduce-shaped batch | LADIS 2009; OSDI 2004 |
| Werner Vogels | design for failure; eventual consistency at scale | Dynamo (SOSP 2007) |
| Pat Helland | immutability; life beyond distributed transactions | CIDR 2007; 2015 |
| Michael Nygard | circuit breaker, bulkhead, timeout, backoff | Release It! (2018) |
| John Ousterhout | deep modules, simple interfaces | PoSD (2018) |
| Leslie Lamport | causal ordering, no global clock | CACM 1978 |
| Eric Brewer | CAP theorem | PODC 2000 |
| Sam Newman | service boundaries along business capability | Building Microservices |
| Gregor Hohpe | the architect elevator: connect engine-room trade-off to business stake | 2020 |
The harness connection
The system-architect agent is itself a harness (Böckeler/Fowler): guides are feedforward, sensors and evals are feedback, humans stay on the loop. A design needs the same split. Computational controls (tests, linters, schema checks) and inferential controls (semantic review) run together. See Harness Engineering and Evals.
References
| Author | Work | Venue |
|---|---|---|
| Martin Kleppmann | Designing Data-Intensive Applications | O'Reilly, 2017 |
| Jeff Dean | Designs, Lessons and Advice from Building Large Distributed Systems | LADIS, 2009 |
| Dean, Ghemawat | MapReduce: Simplified Data Processing on Large Clusters | OSDI, 2004 |
| DeCandia et al. | Dynamo: Amazon's Highly Available Key-value Store | SOSP, 2007 |
| Pat Helland | Life Beyond Distributed Transactions | CIDR, 2007 |
| Pat Helland | Immutability Changes Everything | ACM Queue, 2015 |
| Michael Nygard | Release It!, 2nd ed. | Pragmatic Bookshelf, 2018 |
| John Ousterhout | A Philosophy of Software Design | 2018 |
| Leslie Lamport | Time, Clocks, and the Ordering of Events in a Distributed System | CACM, 1978 |
| Eric Brewer | Towards Robust Distributed Systems (CAP keynote) | PODC, 2000 |
| Birgitta Böckeler | Harness engineering for coding agent users | martinfowler.com, 2026 |
This page mirrors System Design Method in the wiki. Edit it there.