How to Write an Effective Software Design Document
Michael Lynch, excerpt from his forthcoming book Refactoring English: Effective Writing for Software Developers. Lynch has written design docs as a developer at Google, Microsoft, and his own companies.
When Should You Write a Design Doc?
Six yes/no questions: 1. Does the project require coordination among >1 person? 2. Will it take >3 months of full-time work? 3. Will the software remain in production beyond 6 months? 4. Will the project require cross-team coordination? 5. Are there ambiguous or unclear requirements? 6. Would time spent designing prevent a catastrophic future outcome?
Answering yes to any one suggests it's likely worth it; two or more makes it "almost certainly" worthwhile.
How Much Should You Invest?
No universal rule. A design doc can range from a single page to 50 pages requiring multi-team signoff. "Sometimes, the right amount to invest in a design doc is zero."
The Guiding Question
"What's the penalty for being wrong?" — Language/framework choices are high-penalty decisions worth documenting; UI details like "load more" vs. displaying all are trivially changeable and not design-level concerns.
Components of a Design Doc
- Title — Short, distinctive, evocative. "RecencyBank" good; "Project Flying Silver Horse" bad.
- Metadata — Author (name + email), creation date, authoritative URL.
- Objective — Single-sentence purpose statement in plain language on the first page.
- Background — Why the project, what problem, prior attempts. Must make sense to someone who wasn't in the verbal discussions.
- Related Documents — Links to test plans, functional specs, related system designs, prior iterations.
- Goals — Impact on users/team/company, not implementation details. Bad: "Add Kubernetes." Good: "Minimize outages related to deploying new app versions."
- Non-goals — Explicitly states what is out of scope to prevent mistaken assumptions.
- Scenarios — Concrete walkthroughs of how the completed system works in practice.
- Diagrams — "Tremendously valuable" because reviewers lack the author's mental picture. Recommends Excalidraw, draw.io, Mermaid, D2, Graphviz. Warns against whiteboard photos.
- Glossary — Defines internal tools and systems for newer team members and external readers.
- Constraints — Budget, client, infrastructure, or dependency limitations that shape design choices.
- Service Level Objectives (SLOs) — Measurable, concrete goals for uptime/availability, latency, and scale. Example: 50th percentile latency <=200ms for user-facing HTTP requests.
- Monitoring / Alerting — How SLOs will be measured in production, progressing from manual testing to automated alerts.
- Timeline — Milestone-based schedule producing useful stakeholder artifacts. Recommends starting with dummy data. References Joel Spolsky's "Painless Software Schedules."
- Interfaces — Sketches of UI, API/CLI semantics, or file formats.
- Dependencies / Infrastructure — Language, hardware/service, and data persistence decisions.
- Security — Threats considered, attack surface, trust boundaries. Even documenting why threats are unlikely is helpful.
- Privacy — Sensitive data handled, retention periods, access controls, encryption at rest and in transit.
- Legal Considerations — Relevant in regulated domains; also covers open-source license choices.
- Logging — Critical events to log, log levels, storage location, retention, access, sensitive data exclusion.
- Open Issues — Appendix documenting unresolved flaws, trade-offs, information gaps. Each entry: problem, possible solutions, immediate next step.
- Resolved Issues — When an open issue is decided, the entry moves here with decision summary + full original discussion retained.
- Alternatives Considered — Proactively addresses "why didn't you do X?" Explains rejected options, especially appealing ones or those requiring extensive research.
Key Quotes
- "A good design doc can save you years of development time."
- The guiding question: "what's the penalty for being wrong?"
- "Once you've completed your design doc, the next step is to share it with your team and gather feedback."
- On diagrams: "reviewers don't have your mental picture of the system"
Example Design Doc
Lynch created a complete example design doc for a real web app called "Little Moments" — written before any code, adhered to during implementation. Available on Codeberg.
Related Resources
- Example design doc: Little Moments (Codeberg)
- Related article: How to Get Meaningful Feedback on Your Design Document
- Book: Refactoring English: Effective Writing for Software Developers (early access)