Architecture Decision Records
An Architecture Decision Record (ADR) is a short document that captures a single significant architectural decision: the context, the options considered, the decision made and its consequences.
Good architecture favours working software over comprehensive documentation (see the introduction), but some things are worth writing down. The most valuable piece of architectural documentation is often not a diagram of what the system looks like, which is visible in the code and the cloud console, but a record of why it looks that way. Six months later, nobody remembers why the team chose a queue over a direct API call, or why one service runs on containers when everything else is serverless.
ADRs, popularised by Michael Nygard, solve this with a habit rather than a heavyweight process.
What goes in an ADR
Keep each record short, a page at most. A common structure is:
- Title: a short noun phrase, e.g. “Use DynamoDB for session storage”.
- Status: proposed, accepted, superseded (by ADR-xx) or deprecated.
- Context: the forces at play: requirements, constraints, risks and the results of any spikes.
- Decision: what we’re going to do, stated clearly.
- Consequences: what becomes easier or harder as a result, including the trade-offs we’re accepting.
Optionally, list the alternatives considered and why they were rejected. That’s often the part future readers find most useful.
Example
ADR-007: Use managed container hosting for the reporting service
Status: Accepted
Context: The rest of the platform is serverless. Report generation needs a third-party rendering library that requires a full OS environment, and jobs can run for up to 30 minutes, beyond our function timeout. A spike confirmed the library works in a container image.
Decision: Run the reporting service as a serverless container, triggered from the existing job queue.
Consequences: We now maintain a container image and must rebuild it regularly for security patches. Reporting can scale independently. If the library becomes available as a managed service, we will revisit this decision.
Good practice
- Store ADRs with the code, for example in a
docs/adr/folder in the repository, so they’re versioned and reviewed in pull requests alongside the changes they describe. - Write them when the decision is made, not afterwards. Proposed ADRs are a good way to get review and agreement.
- Never rewrite history. When a decision changes, write a new ADR that supersedes the old one, and update the old one’s status.
- Record only significant decisions: those that are hard to reverse, affect several teams, or that someone will one day ask “why did we do that?” about. Dropping down a level in the mental model is a good example.
- Link them from diagrams, READMEs and the architectural profile where helpful.