Architecture decision records¶
An architecture decision record, or ADR, is a short document that captures one significant technical decision, the context that forced it and the options we weighed. This page explains why we keep ADRs, which format we use and how an ADR moves from a proposal to an accepted decision. To write one, follow Propose an architecture decision. The file names, frontmatter fields and templates are listed in the ADR conventions reference.
Why we record decisions¶
Code records what we built but rarely why. A year after a team picks Pub/Sub over Cloud Tasks, someone will ask the reason, and the people who made the choice may have moved on. Without a record we either repeat the original discussion or change something without understanding the trade-off it was protecting.
An ADR keeps that reasoning next to the code it explains, in version control, where it is reviewed like code. Our process aligns closely with established patterns from organisations such as Rust, AWS and the Government Digital Service (GDS), which the sections below refer to.
When to write one¶
Write an ADR when a decision is hard or expensive to reverse, changes the structure or behaviour of a system, or picks one option over others that were also reasonable. Choosing a database, a hosting platform, an authentication approach or a deployment pattern all qualify. Naming a variable or bumping a minor dependency does not. If a new team member might one day ask "why did we do it this way?", the decision is worth recording.
An issue tracks work and closes when the work is done. A design document explores a whole design before it is built, and can lead to several ADRs. An ADR records one decision and why we made it, and stays relevant for as long as the decision does.
Where ADRs live¶
An ADR lives with the thing it decides. A decision about one service goes in that service's repository, and its team decides it. A decision that affects several teams or the whole division goes to the Tech Lead Forum, and is recorded in the forum's project.
Each repository records only its own decisions. Our copier boilerplates keep ADRs about the boilerplate itself, but they don't generate ADRs into the projects created from them. A generated ADR would record, as accepted, a decision the project's team never made. Start recording architecture decisions in a project covers setting a project up.
The format we use¶
We use MADR, Markdown Architectural Decision Records. The Tech Lead Forum and several of our projects already use it. YAML frontmatter records the status, the date and the people involved, and the sections walk through the context, the options considered and the outcome. Most sections are optional, so a small decision stays short.
Files are named with a four-digit sequence number and a short title, such as
0007-use-pub-sub-for-notifications.md. Sequential numbering comes from Michael Nygard's
original article on ADRs,
and MADR and most ADR tooling follow it. The number gives each decision a stable short name,
ADR-0007, and shows the order in which decisions were made.
How a decision moves through its life¶
A proposal is a merge request. While it is open, the file is named 0000-<title>.md and its status
is proposed. Any number of proposals can be open at once without clashing, because none of them
has claimed a number. Discussion happens on the merge request.
A proposal normally names the author's preferred option in its Decision Outcome. That is a starting point for discussion, based on the author's best understanding, and the pros and cons of each option show why it looks strongest. Sometimes the right answer really is unclear and the debate is the point. Then the proposal can lay out the options and leave the outcome empty until the decision makers have chosen.
Once the decision makers approve the proposal, the author renames the file to the next free number,
sets the status to accepted and sets the date to the day of approval. Then the merge request is
merged. The default branch therefore holds only decisions that have been made, and every number and
date in it is final. This is the model the GDS Way
describes, where the state of the pull request stands for the state of the decision.
Rust's RFC process works the same way,
with proposals starting as 0000- files that only get a number on acceptance.
A rejected proposal usually ends with the merge request being closed. Sometimes the rejection is
worth keeping, for example when we ruled out an option that people will keep suggesting. Then it is
numbered and merged with the status rejected, so the reasoning is easy to find.
Some communities, such as Python with its PEPs, merge proposals early as drafts and number them straight away. That suits proposals that large groups debate for months, with editors to look after the drafts. At our scale, a proposal that has been open for months is a decision that hasn't been made yet, and an open merge request says so.
After a decision is accepted¶
Once an ADR is accepted, its decision is fixed. Everything around the decision can still be corrected. If the context, decision drivers or considered options turn out to rest on a wrong assumption, we fix them in place, as long as the decision still stands once they are fixed. The wording of the decision itself only changes for typos or small fixes that leave its meaning intact. Links, formatting and the status can change too.
An ADR that keeps a known mistake in its background misleads everyone who reads it later, and a superseding ADR that repeats the same decision only adds noise. The git history still records what the ADR said before.
When a decision changes, or a correction would undermine it, we write a new ADR that supersedes
the old one.
The old ADR keeps its number and content, and its status becomes superseded by ADR-NNNN, so
anyone reading it can follow the trail. A decision that no longer applies and has no replacement,
such as one about a decommissioned service, is marked deprecated.