Design Doc Template
A design doc describes how you plan to solve a technical problem before you build it, so other people can find the flaws while they're cheap to fix. It needs the context and goals, what's explicitly out of scope, the proposed design, the alternatives you rejected and why, the risks, and how the change will roll out and be undone. The template below has each of those sections, in the order reviewers read them.
Design doc (markdown)
# [Design name]
**Author:** [Name] · **Reviewers:** [Names] · **Status:** [Draft / In review / Approved / Superseded]
**Last updated:** [Date]
## Context
[What exists today and what's wrong with it, in a few paragraphs. Include
the numbers that make the problem real: error rates, latency, cost, hours
spent. A reviewer who knows nothing about this area should understand why
this doc exists.]
## Goals
- [Measurable outcome, e.g. "p95 checkout latency under 400 ms"]
- [Measurable outcome]
## Non-goals
- [Something a reader might reasonably expect this to do, that it won't]
- [Something deliberately left for later]
## Proposed design
[The design in enough detail that someone else could build it. Start with
a diagram or a short overview, then go component by component.]
### Data model / API changes
[New tables, fields, endpoints, events. Show the shapes.]
### Key flows
[Step-by-step for the two or three most important paths, including what
happens when something fails.]
## Alternatives considered
### [Alternative A]
[What it is, why it's attractive, and the specific reason it lost.]
### [Alternative B]
[Same.]
### Do nothing
[What happens if we don't build this. Sometimes this is the right answer.]
## Risks and open questions
| Risk / question | Impact | Mitigation or owner |
|---|---|---|
| [Risk] | [What breaks] | [Plan] |
| [Open question] | [What it blocks] | [Who decides, by when] |
## Security, privacy and cost
[New data stored, new access paths, new spend. "None" is a valid answer if
you checked.]
## Rollout and rollback
[How it ships: flags, migration order, phases. How to undo each step.]
## Testing and monitoring
[How we'll know it works before and after launch: tests, dashboards, alerts.]
## Decision log
- [Date] — [Decision and who made it] Writing it so reviewers can say yes or no
- 1
Write context and goals, then stop
Share just those two sections with one reviewer before designing anything. Disagreement about the problem is cheaper to settle before there's a solution to defend.
- 2
Write the non-goals deliberately
List the things a reader would reasonably assume are included. Each one you write down is a scope argument you won't have in review.
- 3
Describe the design, including failure paths
For each key flow, say what happens when a dependency is slow, down or returns garbage. Happy-path-only designs pass review and fail in production.
- 4
Give the alternatives a fair hearing
Describe each one as its strongest advocate would, then give the specific reason it lost. Include doing nothing.
- 5
Plan the rollout backwards
Start from how you'd undo it. If a step can't be rolled back, say so and explain why that's acceptable.
- 6
Record decisions as they happen
When review settles a question, add it to the decision log with a date. Months later, that log is the part people look for.
What each section protects you from
- Context
- Reviewers approving a solution to a problem they don't share. Numbers in this section make the cost of the status quo concrete.
- Goals and non-goals
- A review that drifts into features nobody asked for. Measurable goals also become the launch checklist.
- Alternatives considered
- The same idea being proposed again in six months by someone who doesn't know it was rejected, or why.
- Risks and open questions
- Unknowns that surface mid-build with nobody owning them. Giving every open question an owner and a date turns it into a task.
- Rollout and rollback
- A launch with no way back. Writing the rollback is often where you find a step that can't be undone.
Example: alternatives done badly, then properly
From a doc proposing to move image resizing from the web servers to a background queue. Details are illustrative.
Weak
Alternatives: We considered using a third-party image service but decided against it.
No reviewer can check this reasoning, and nobody later will know whether "decided against it" was about price, privacy or someone's preference.
Useful
Hosted image service. No resizing code to maintain, and a CDN included. Rejected because customer uploads include signed contracts, and the service would store copies outside our hosting region, which our data agreement with two enterprise clients doesn't allow. Revisit if those agreements change.
Do nothing. Upload requests currently time out on large files a few times a week; support handles each manually. Acceptable for now, but each new enterprise client with large scans makes it worse.
The strongest argument for each option, the specific reason it lost, and the condition under which the decision should be revisited.
How design docs go wrong
- It's written after the decision. The doc only describes the chosen option, so review becomes a formality and the real trade-offs are never recorded.
- It's all implementation detail. Class names and function signatures, but no statement of the problem. Reviewers can check the code-level design and still miss that the approach is wrong.
- Open questions have no owner. "TBD: how do we migrate existing data?" sits in the doc through approval and becomes the riskiest week of the project.
- It never changes after approval. The build diverges and nobody updates the doc, so it misleads the next reader. A one-line note under the decision log is enough to keep it honest.
FAQ
- Is a design doc the same as a technical spec?
- The terms overlap and many teams use them interchangeably. Where they're separated, the design doc argues for an approach and records the alternatives, and the technical spec details the chosen approach for whoever builds it. For most projects one document doing both is enough.
- How long should a design doc be?
- Long enough for a reviewer outside your team to understand the problem, the proposal and why the alternatives lost. For a contained change that might be two pages; for a new system, considerably more. If it's getting very long, the design may be several designs.
- When is a design doc not worth writing?
- When the change is cheap to reverse, stays inside one team's code, and nobody needs to approve it. Writing one for a routine change slows the work down and trains people to skim design docs.
- Who should review it?
- The people who'll build it, the owners of every system it touches, and at least one person who wasn't involved in the idea. That last reviewer catches the assumptions everyone else stopped seeing.
- What happens to the doc after the build?
- Mark its status (approved, implemented, superseded) and leave it where people can find it. Its real long-term value is explaining why the system looks the way it does, so keep the alternatives and decision log intact.