The Short Answer
How should software architecture be documented?
Keep two things up to date. Architecture decision records (ADRs) are short notes explaining each significant decision, why it was made and what was rejected. A small set of diagrams following the C4 model shows the system at increasing levels of detail. Store both alongside the code so they change with it.
This is the documentation that matters most when a new developer joins, when you change suppliers, or when an investor runs technical due diligence.
Read the transcript
A new developer asks a simple question. Why did we build it this way? Nobody remembers. The person who decided left last year. Most architecture documents are written once and never read. But two lightweight habits stay useful. So what should you actually write down? First, decision records. A short note for each big choice: the context, the decision, what was rejected, and the consequences. They take minutes to write at the time, and are impossible to recreate later. Second, C4 diagrams. They show the system at different levels of zoom, like a map. Keep the first two current: the system in context, and its containers. Draw components and code only when you need them. Store both next to the code, so they change with it. Write down the why, while someone still remembers it. The full guide is free at loomstrat.com.
Architecture Decision Records
Michael Nygard proposed ADRs in a 2011 article. Each record is a short text file, numbered in order, describing one decision.
| Section | What to write |
|---|---|
| Title | A short name, such as “Use PostgreSQL for the main database” |
| Status | Proposed, accepted, superseded |
| Context | The situation and forces that led to the decision |
| Decision | What was chosen |
| Consequences | What becomes easier, what becomes harder, risks accepted |
| Alternatives | Options considered and why they were rejected |
Records are never edited to change history. When a decision changes, a new record supersedes the old one, so the reasoning trail stays intact. More templates are collected at adr.github.io.
What deserves an ADR
- Choice of language, framework, database or hosting; see choosing a tech stack.
- How tenants are separated in a multi-tenant system.
- Monolith or services; see monolith vs microservices.
- Authentication approach, third-party services and anything expensive to reverse.
The C4 Model
Simon Brown’s C4 model describes a system with diagrams at four levels of zoom, like a map.
| Level | Shows | Audience |
|---|---|---|
| 1. System context | Your system, its users and the other systems it talks to | Everyone, including non-technical people |
| 2. Containers | The applications and data stores: web app, API, database, queue | Technical people, operations |
| 3. Components | The major parts inside one container | Developers |
| 4. Code | Classes and functions | Rarely drawn by hand; generated if needed |
Most teams keep levels 1 and 2 current and draw level 3 only for complex areas. Diagrams written as text, with tools such as Structurizr, Mermaid or PlantUML, can live in the code repository and be reviewed like code.
Other Documentation Worth Having
- A README that gets a new developer from nothing to a running system.
- Runbooks for deploying, restoring backups and handling common incidents; see incident response.
- An API description, such as OpenAPI, generated from the code where possible.
- A data model overview of the main entities and relationships.
- Security notes: where secrets live, how access is granted, how data is protected.
What to Ask Your Developers For
- 1
Agree it in the contract
Name the documents to be delivered and kept current; see software development contracts.
- 2
Ask for ADRs from the start
They cost minutes each when written at the time and are impossible to recreate accurately later.
- 3
Review the context diagram
If you cannot understand level 1, ask for it to be clearer.
- 4
Check at handover
Use our software handover checklist.
Frequently Asked Questions
What is an ADR?
An architecture decision record: a short document recording one significant technical decision, its context, the alternatives and the consequences.
What is the C4 model?
A way of diagramming software at four levels: system context, containers, components and code.
Where should architecture documentation be stored?
In the code repository, as text files, so it is versioned and reviewed alongside the code it describes.
How much documentation is enough?
Enough for a competent new developer to understand the system and its key decisions in a day or two. ADRs plus C4 levels 1 and 2 cover most of it.
Is documentation worth it for a small startup?
A light version is. A handful of ADRs and one diagram take little time and greatly reduce the cost of hiring, handover and due diligence.