Shelves / Senior Engineering Craft
SC·01
Design Docs and RFCs
Why senior engineers write before they build: writing as a tool for thinking, the low cost of changing a design on paper, and review that reaches the right people; when a doc is worth writing and which kind (one-pager, design doc, RFC, ADR); the sections that matter and how to write each, from measurable goals and non-goals to honest alternatives, cross-cutting concerns, rollout and rollback; running a review that ends in a decision; how to review someone else's design; and the failure modes; with a lab that checks two drafts of the same proposal.
Start here: two drafts of one proposal
You want TiffinBox's kitchen reports to update within a minute instead of overnight. Your first draft:
Order events pipeline. We want to make reporting better and more real-time. We will use Kafka and Debezium to stream changes. Design: Debezium reads the WAL and writes to Kafka topics. Consumers update the reporting tables. This is the industry standard and scales well. Timeline: TBD.
A teammate asks four questions: Better by how much? Why not just run the batch more often? What happens to the database if the consumer falls behind? Who runs Debezium? The draft answers none of them. Your second draft has a context section with a number (31% of October's support tickets were about missing orders), measurable goals (visible within 60 s at p99; no change to checkout latency), a non-goal, two alternatives with their costs, two risks with mitigations, a shadow-mode rollout, and one honest open question.
The lab ran a simple checker over both:
| Draft 1 | Draft 2 | |
|---|---|---|
| words | 49 | 195 |
| standard sections missing | all 8 | none |
| numbers in the goals | 0 (no goals section) | 9 digits (60 s, p99, 300 ms…) |
| alternatives considered | 0 | 2 |
| "TBD"s | 1 | 0 |
| vague claims ("better", "scales well", "industry standard") | 3 | 2 (both false positives: "faster batch" and "simple" in the alternatives) |
Draft 2 is four times longer and still a two-minute read. More importantly, writing it changed the design: thinking about the alternatives showed that a five-minute batch might have been enough if the goal were five minutes; thinking about risks surfaced replication-slot lag, which can fill the primary database's disk. That's the point of a design doc: it's cheaper to change a design in a document than in production.
How deep to go
Volume 17 defines six mastery levels. For design docs:
| Level | What you can do |
|---|---|
| L1 | Read design docs and follow the decisions in them |
| L2 | Write a clear doc for a feature with goals, proposal and alternatives |
| L3 | Write and drive docs for systems, including cross-cutting concerns, rollout and migration |
| L4 | Review others' designs and find the risks and missing alternatives |
| L5 | Run a team's design process: templates, review norms, decision records |
| L6 | Shape an organisation's technical direction through written strategy and RFC processes |
Why write before building
Four reasons, in order of value:
- Writing is thinking. A design in your head feels complete because you skip the hard parts without noticing. Writing forces each step to connect. Most authors find their first major flaw while writing, before anyone reads the doc.
- Change is cheap on paper. Moving a box on a diagram costs minutes; moving a service boundary after launch costs months, plus a migration. Reviews catch problems at the cheapest point.
- The right people can review asynchronously. Security, data, mobile and operations reviewers can comment on their part in their own time, across time zones, without a meeting for everyone.
- It records why. Two years later, someone will ask why the system works this way. Code shows what; a doc (or an ADR) shows the context, the alternatives and the reasoning, so the decision can be revisited intelligently rather than repeated or blindly reversed.
Which kind, and when
| Kind | Size | Use when |
|---|---|---|
| pull request description | paragraphs | the change is self-contained and reviewable in code |
| one-pager | 1 page | an idea needs a yes/no on direction before investment |
| design doc | 3–10 pages | a feature or system takes more than a few weeks, crosses teams, adds infrastructure, or is hard to reverse |
| RFC | varies | a change affects many teams or the public (an API, a standard, a platform), with a formal comment period |
| ADR | half a page | recording one significant decision, linked from the code |
| strategy / vision doc | 5–15 pages | setting direction for an area over a year or more |
Open-source projects show mature versions: Python's PEPs, Rust's RFCs, Kubernetes' KEPs and Java's JEPs all combine a template, a public review period and a recorded decision.
A rule of thumb: write a design doc when the cost of being wrong is high (irreversible, expensive, cross-team) or the path is genuinely uncertain. Don't write one to look thorough; a doc no one needs costs the author and every reviewer.
The sections, and how to write each
Header
Title, author(s), reviewers and approvers (named people), status (draft, in review, approved, implemented, superseded), dates, and links to the ticket, earlier docs and the decision record.
Context and problem
Explain the situation to a reader who wasn't in your meetings. Lead with evidence: data, incidents, user complaints, costs. "Kitchen reports are built nightly, so kitchens see orders up to 24 hours late; 31% of October's support tickets asked about missing orders." State the problem, not the solution ("we need Kafka" is a solution).
Goals and non-goals
Goals are measurable outcomes, not activities: a number, a unit, a percentile, a date. "Orders visible in kitchen reports within 60 s (p99) of commit; checkout p99 latency stays under 300 ms." Non-goals mark the edges: "Not replacing the finance export." Reviewers judge the design against these, so disagreements about goals surface early, where they belong.
Proposal
The design itself, at the level of detail that lets a reviewer find problems:
- an architecture diagram (components and what calls what; Volume 4);
- the data model and schema changes;
- APIs and events, with examples;
- key flows as sequence diagrams, including the failure paths;
- how it meets each goal.
Explain the reasoning for each significant choice; don't just list choices.
Alternatives considered
At least two real alternatives, including "do nothing" or "the simplest thing", each with honest pros, cons and why you didn't choose it. If the alternatives section is weak, reviewers can't tell whether you chose well or chose first. Chapter 04's decision techniques belong here.
Cross-cutting concerns
A checklist reviewers rely on, answered briefly where they don't apply:
| Concern | Questions |
|---|---|
| security and privacy | new data? who can access it? threat model (Volume 10)? personal data retention? |
| reliability | failure modes, timeouts, retries, idempotency, capacity (Volume 5) |
| observability | metrics, logs, traces, alerts, dashboards, SLOs (Volume 7) |
| performance and cost | latency budget, load estimates, cloud cost per month |
| data and migration | backfill, dual writes, schema evolution, rollback of data |
| operations | who runs it, on-call, runbooks |
| compatibility | old clients, API versions, mobile apps that update slowly (Volume 22) |
| i18n and accessibility | Volume 23; Volume 2 |
| testing | how correctness is shown before and after release |
Risks, rollout and rollback
Name the risks and their mitigations. Describe the rollout in stages (shadow mode, percentage rollout, per-region), the metrics that decide each step, and how to roll back, including data.
Open questions and decision log
List what you don't know, each with an owner and a date. As reviews proceed, record decisions and changes at the end so later readers see how the design evolved.
Writing it well
- Answer first. The first paragraph says what you propose and what you need from readers (chapter 06).
- Specific over general: numbers, names, examples; avoid "robust", "scalable", "best practice" without evidence.
- Diagrams for structure, prose for reasoning.
- Define terms once; use one name per thing.
- Short is a feature: 3–10 pages for most designs; move details to appendices.
- Write for the skeptical, busy expert who will read it once.
Running a review
- Pick reviewers deliberately: the owners of systems you touch, a security or data reviewer when relevant, and one person likely to disagree. Distinguish approvers (must agree) from consulted reviewers (input welcome).
- Share early: a rough doc with the main idea and alternatives, before you've invested in details, invites useful feedback. A polished doc invites polish.
- Timebox the comment period (often one week).
- Resolve every comment: change the doc, answer it, or move it to open questions. Don't leave threads hanging.
- Meet only for real disagreements. Some organisations start review meetings with 10–20 minutes of silent reading (Amazon's six-page memo practice), so everyone discusses the same text.
- Record the decision and who made it. If approvers disagree, escalate with a short summary of the options, not a re-run of the debate.
- Keep it current: mark the doc implemented or superseded; link it from the code (README, ADR).
Reviewing someone else's design
Good questions find risks without taking over the design:
- What problem are we solving, and how will we know we've solved it?
- What's the simplest thing that could work, and why isn't it enough?
- What happens when each dependency is slow, down or returns garbage?
- What's hard to reverse here?
- Where will this be in two years at ten times the load or the team size?
- Who runs it at 3 a.m., and what will they see?
- What did you consider and reject, and why?
Separate blocking concerns (correctness, security, irreversible risks) from suggestions, say which is which, and explain your reasoning. Approving is a commitment: "LGTM" from someone who didn't read it is worse than no review.
Failure modes
- The justification doc: written after the decision, to approve what's already built; alternatives are strawmen.
- No doc: big, irreversible decisions made in a meeting and remembered differently by everyone.
- The novel: 40 pages no one reads; the important risk is on page 31.
- Design by committee: every comment accepted; the design loses its coherence. The author owns the design and can decline suggestions with reasons.
- Bikeshedding: discussion of naming and formatting while the risky part goes unreviewed.
- Stale docs: the system changed; the doc misleads. Mark superseded docs, and prefer ADRs for decisions that evolve.
Common traps
- Goals that are activities ("migrate to Kafka") rather than outcomes.
- No alternatives, or strawman alternatives.
- Skipping rollout, rollback and operations.
- Waiting too long to share.
- Reviews that never end in a recorded decision.
Lab: checking a design doc
Setup. A 30-line Python checker (lint.py) reads Markdown design docs and reports: word count; which of eight standard sections (context, goals, non-goals, proposal, alternatives, risks, rollout, open questions) are missing; how many digits appear in the goals section (a rough proxy for measurable goals); how many alternatives are listed; how many "TBD"s remain; and matches for a list of vague words ("better", "faster", "scales well", "industry standard", "robust", "simple"). It ran on the two drafts from the start of the chapter, both written for this lab. The checker is a heuristic aid, not a judge of quality: it can't tell whether a goal is the right goal, and its word list produces false positives.
Results
| Draft 1 | Draft 2 | |
|---|---|---|
| words | 49 | 195 |
| missing sections | context, goals, non-goals, proposal, alternatives, risks, rollout, open questions | none |
| digits in goals | 0 | 9 |
| alternatives | 0 | 2 (faster batch; outbox events) |
| TBDs | 1 | 0 |
| vague-word matches | 3: better, industry standard, scales well | 2: faster, simple |
Both of draft 2's matches were in the alternatives section, describing an alternative's real property ("Faster batch… simple"): false positives, as a human reviewer sees at once.
What it shows
- Structure prompts thinking: the empty sections in draft 1 are exactly the questions reviewers asked.
- Measurable goals are checkable: draft 2's goals contain numbers, units and percentiles that the rollout section can test.
- A longer doc can be a faster review: draft 2 answers the questions that would otherwise take a meeting.
- Automated checks catch omissions, not judgment: use them as a template's safety net and leave quality to reviewers.
Try it yourself
- Run the checker on the last design doc or long ticket you wrote; fix what it finds.
- Add a check that every risk line has a mitigation, and that every open question names an owner.
- Write a one-page doc for a real change at work; ask one reviewer to find the biggest risk you missed, and time how long the review took.
- Take a famous public design proposal (a Python PEP or a Rust RFC) and map its sections to this chapter's list. What does it add?
- Rewrite draft 1's goal "make reporting better" three ways with different numbers, and note how each would change the design.
Revision sheet: design docs and RFCs
Key ideas
- Design docs exist to think, to get cheap early feedback from the right people, to align, and to record why.
- Write one when work is large, cross-team, risky or hard to reverse; otherwise use a PR description or ticket.
- Kinds: one-pager, design doc, RFC, ADR, strategy doc.
- Sections: header, context with evidence, measurable goals and non-goals, proposal with diagrams and failure paths, honest alternatives, cross-cutting concerns, risks, rollout and rollback, open questions with owners, decision log.
- Answer first, be specific, keep it short, write for the busy skeptic.
- Review: deliberate reviewers (approvers vs consulted), share early, timebox, resolve every comment, record the decision.
- When reviewing: ask about the problem, the simplest alternative, failures, irreversibility, scale, operations; mark blocking vs suggestions.
- Failure modes: justification docs, novels, design by committee, bikeshedding, stale docs.
Numbers to remember
- 3–10 pages for most design docs; about a week for comments.
- Lab: draft 1 missed all 8 sections; draft 2 missed none.
Glossary
- RFC: request for comments, a proposal open to wide review.
- ADR: architecture decision record.
- Non-goal: something deliberately out of scope.
- Approver / consulted: reviewers who must agree / who give input.
- Shadow mode: running new code alongside the old without using its output.
- Bikeshedding: spending review time on trivial details.