Writing Architecture Decision Records: Document Trade-offs, Not Just Decisions
From Mid-Level to Senior · Part 17 of 18
- #Architecture
- #documentation
- #leadership
- #senior-engineer
You've probably been in this meeting. Someone new to the team, or someone who's been around a while and just got annoyed, asks why the service does something in a way that looks odd. Why is there an outbox table? Why aren't we using the message queue we already pay for? Why is this one service on a different database?
Nobody in the room quite remembers. The person who made the call left last year. Someone half-remembers that "there was an incident". Forty minutes later, the group has rebuilt about two thirds of the original reasoning, skipped the part that actually mattered, and decided to change it. Three months after that, the original problem comes back.
The decision wasn't the problem. Losing the reasoning was. Architecture decision records (ADRs) are a cheap way to keep it: short documents, stored next to the code, that say what was decided, why, what else was considered, and what it cost. They take half an hour to write, and they save the team from paying for the same discussion twice.
Part 13 ended with a few informal lines under "decide, and write down why". This part turns those lines into a proper format, with a full example, and covers the habits around it: when to write one, where to keep them, and how to handle a decision that changes later.
What an architecture decision record is (and isn't)
An ADR records one decision. Not a design document, not a wiki page about the whole system, not meeting notes. One significant choice, with enough context that someone who wasn't there can understand why it made sense at the time.
The format most teams use comes from a 2011 blog post by Michael Nygard, and it's deliberately small. A title, a status, and three sections: context, decision, consequences. Most ADRs fit on one or two screens. If yours is running to ten pages, it's probably a design document that should link to an ADR, not the other way round.
It also isn't permanent truth. An ADR describes what was right under the conditions at the time. Conditions change, and when they do, you write a new ADR. The old one stays as a record of what the team knew back then. That's the part that makes the whole thing useful, and it's covered further down.
The format: context, decision, consequences, status
Title. A number and a short phrase, written as the decision itself: "ADR-0007: Notify the warehouse through a transactional outbox". Not "Warehouse integration" or "Messaging". Someone scanning the folder should learn something from the file names alone.
Status. Proposed, Accepted, Superseded or Deprecated. It's one line, and it's the first thing a reader needs, because it tells them whether the rest still applies.
Context. The forces that shaped the decision: requirements, limits, team size, deadlines, what you measured, what you didn't know. This is the most valuable section and the one people rush. Write it so that it reads as true on the day the decision was made, including the uncomfortable parts ("we have two weeks", "nobody on the team has run Kafka").
Decision. What you're going to do, in one or two sentences, in active voice. "We will write an outbox row in the same transaction as the order and relay it with a scheduled job." Short is fine. The decision is usually the least interesting part of the record.
Consequences. What gets easier, what gets harder, and what you now have to keep an eye on. This is where you document the trade-off, not just the decision. If the consequences section only lists good things, it's a sales pitch, and the next reader will (correctly) not trust it.
Two optional sections earn their place often enough that many teams add them to the template:
- Options considered. The serious alternatives and why each one lost. This is what stops the "did anyone think of X?" conversation, because the answer is written down.
- Revisit if. The conditions that would reopen the decision. Part 13 called this the most useful line, and it still is: it turns "this is how we do it" into "this is right while these things are true".
A filled-in example
Here's the decision from Part 13's worked example, written as a full ADR.
To recap the situation: order-service has to tell another team's
warehouse system about every paid order. The warehouse API goes down for
about half an hour every night, it's slow when busy, and checkout must not
depend on it.
# ADR-0007: Notify the warehouse through a transactional outbox
- Status: Accepted
- Date: 2026-03-12
- Deciders: order-service team (5 engineers), reviewed by the warehouse team
## Context
When an order is paid, the warehouse system must be told so it can ship.
The warehouse API belongs to another team. We can't change it.
- Every paid order must reach the warehouse. A missed one means an order
that never ships, a refund and a support ticket.
- The warehouse API is down ~30 minutes every night for maintenance and
takes up to 1 second to respond under load.
- A delay of a few minutes is acceptable.
- The API accepts the order id as an idempotency key.
- Volume is ~3,000 orders/day, well under 1 event/second at peak.
- The team already runs PostgreSQL and a message queue. Nobody wants new
infrastructure for this.
## Decision
We will write an outbox row in the same database transaction that marks
the order as paid. A scheduled job in order-service reads unsent rows,
calls the warehouse API with the order id as idempotency key, and marks
them sent.
## Options considered
1. **Call the warehouse inside checkout.** Simplest code. Rejected: checkout
fails or loses orders during the nightly window, and every checkout
waits on another team's latency.
2. **Commit, then publish to the queue.** Good availability. Rejected: a
crash between commit and publish loses the event, and correctness is
our top priority.
3. **Outbox streamed to the queue with change data capture.** Correct and
scalable. Rejected for now: a new tool to run for a volume a scheduled
job handles easily.
## Consequences
- Checkout no longer depends on the warehouse being up.
- No paid order is lost: the order and the outbox row commit together, and
duplicates are absorbed by the idempotency key.
- Notifications are delayed by up to one polling interval plus retries.
- We now own an outbox table and a job. We need an alert on the age of the
oldest unsent row, and a cleanup for sent rows.
- The relay holds a transaction open while calling HTTP. Fine for batches
of 20 at this volume; the first thing to change if volume grows.
## Revisit if
- Volume passes ~50 events/second, or
- A second consumer needs these events (then the relay should publish to
the queue instead of calling the warehouse directly).
A few things to notice.
The context has numbers in it. "Down about 30 minutes a night", "3,000 orders a day", "five engineers". Numbers are what let a future reader tell whether the context still holds. "The warehouse is sometimes unavailable" gives them nothing to check.
The rejected options are described fairly. Option 3 isn't dismissed as over-engineering; it's described as correct and rejected for a specific, dated reason. When someone proposes CDC in a year, the ADR doesn't say they're wrong. It says what would have to be true for them to be right.
The consequences include the costs. A new table, a job, an alert to build, a known weakness in the relay. The person who gets paged about the outbox at 3 a.m. will be very glad that's written down.
And it's about one screen long. You could write this in half an hour, most of it spent on the context.
When to write one (and when not to)
If you write an ADR for every choice, people stop reading them. If you write none, you're back in the forty-minute meeting. The useful middle is decisions that are hard to reverse or affect people outside the room, ideally both.
A few questions that help sort it out:
- Would undoing it take more than a sprint? A new datastore, a change in how services talk to each other, a public API contract, an auth approach. Write one.
- Does it change how other teams or future hires have to work? A shared event format, a rule about which service owns which data. Write one.
- Did you seriously consider more than one option? If the team argued about it for more than a meeting, the reasoning is worth keeping.
- Is someone likely to ask "why?" in six months? That's exactly the question an ADR answers.
And the things that usually don't need one: which JSON library to use, a naming convention, a small refactor, anything you could revert in an afternoon. A clear pull request description covers those. Pull Requests Worth Reviewing is about that kind of writing, and it's the same skill at a smaller scale.
One more case that's easy to miss: decisions you make by not doing something. "We will not split the order service yet" is a decision. Microservices vs. Monolith argued that staying put is often the right call, and an ADR is how you make that call visible instead of it just looking like nobody got around to it.
Keep them in the repo, next to the code
The best place for ADRs is usually a folder in the repository they describe:
order-service/
├── docs/
│ └── adr/
│ ├── template.md
│ ├── 0001-use-postgresql-for-order-storage.md
│ ├── 0002-expose-orders-through-a-rest-api.md
│ ├── ...
│ └── 0007-notify-the-warehouse-through-an-outbox.md
├── src/
└── pom.xml
Keeping them in the repo has a few advantages over a wiki:
- They're reviewed like code. A new ADR arrives as a pull request with status Proposed. Comments happen on the PR, the decision is made there, and merging it with status Accepted is the moment it becomes real.
- They travel with the code. Branch, fork, move to another Git host: the records come along. Wikis tend to drift away from the thing they describe.
- They're found where people look. Engineers read the repo. Fewer of them read the wiki.
- History is free. Git already tracks who changed what and when.
For decisions that cross several services (an event format every team
uses, say), a small dedicated repo or a shared architecture folder works
better than copying the same ADR into five places. Pick one home per
decision and link to it from everywhere else.
You don't need tooling. A template file and the next free number are enough. If you want to save yourself the counting, a small script does it:
#!/usr/bin/env bash
# Usage: ./new-adr.sh "Notify the warehouse through an outbox"
set -euo pipefail
dir=docs/adr
last=$(ls "$dir" | grep -Eo '^[0-9]{4}' | sort -n | tail -1 || true)
next=$(printf '%04d' $((10#${last:-0} + 1)))
slug=$(echo "$1" | tr '[:upper:]' '[:lower:]' | tr -cs 'a-z0-9' '-' | sed 's/^-//; s/-$//')
file="$dir/$next-$slug.md"
sed -e "s|{{NUMBER}}|$next|" -e "s|{{TITLE}}|$1|" -e "s|{{DATE}}|$(date +%F)|" \
"$dir/template.md" > "$file"
echo "Created $file"
It expects a docs/adr/template.md with {{NUMBER}}, {{TITLE}} and
{{DATE}} placeholders, finds the highest number in the folder, and
creates the next file. (The 10# is there so 0008 isn't read as an
octal number.) If you'd rather use something ready-made, adr-tools and
the MADR template are both popular and do the same job with more options.
Status and superseding: don't rewrite history
Here's the rule that makes ADRs trustworthy: once an ADR is accepted, you don't edit its decision. You can fix a typo. You don't change what it says was decided or why.
When the decision changes, you write a new ADR that supersedes the old one, and you update the old one's status line to point at it.
Continuing the example: say that months later the billing team also needs to know when orders are paid. That's exactly the "revisit if" condition in ADR-0007. So someone writes ADR-0012, "Publish order events to the queue through the outbox relay", with its own context (two consumers now, the volume today) and its own consequences. When it's accepted, ADR-0007's status line becomes:
- Status: Superseded by ADR-0012
Everything else in ADR-0007 stays as it was. That's the point. A reader can follow the chain and see not just what the system does today, but how it got there and why each step made sense when it was taken. If you rewrite the old record instead, you lose exactly the part that stops people from repeating old mistakes.
Two other statuses are worth using. Rejected is for proposals the team decided against. Keep those too: the next time someone suggests the same thing, the reasons are already there, and the conversation can start from "what's changed since?" instead of from zero. Deprecated is for decisions about something that no longer exists, like a service that was shut down.
How ADRs stop the same argument from coming back
Re-litigation is expensive in a way that's easy to miss, because it doesn't show up as a single cost. It's an hour here, a long thread there, a design review that drifts back into a question everyone thought was settled. And sometimes it's worse: a decision gets quietly reversed by someone who didn't know why it was made, and the original problem comes back in production.
An ADR changes the shape of that conversation. Without one, the question is "why do we do it this way?", and the answer depends on who's in the room. With one, the question becomes "has the context changed?", and there's a written context to compare against. Sometimes it has, and you write a new ADR. Often it hasn't, and the discussion is over in five minutes with nobody feeling ignored, because their alternative is right there in "options considered" with the reason it lost.
That's also why the options-considered section matters so much. People are much more willing to accept a decision they disagree with when they can see their idea was taken seriously.
How they speed up onboarding
A new engineer reading the code sees what the system does. They can't see why, and the why is most of what makes them effective. Without it, they either copy patterns they don't understand or "fix" things that were deliberate.
A folder of ADRs is a reading list for that. Twenty short records, read in order, tell the story of how the system got to where it is: which choices were made on purpose, which were constraints of the time, and which are open to change. It's a lot faster than piecing it together from Slack history and the people who happen to be around.
This connects to Part 16. A good ADR is mentoring in written form. It shows how the team reasons about trade-offs, to every future engineer, without anyone needing to be in the room. If you're leading the technical side of a team, asking for an ADR on the next big decision is also one of the cheapest ways to get a mid-level engineer practising senior-level thinking: they have to name the forces, compare real options and own the downsides in writing.
Writing ones people actually read
- Write it while the decision is fresh. Ideally as part of making it. An ADR reconstructed three months later is mostly guesswork, and it tends to leave out the messy constraints that actually drove the choice.
- Spend your time on the context. The decision is one sentence. The context is what lets someone judge whether it still holds.
- Use numbers and dates. Volumes, latencies, team size, deadlines. They're what a future reader can check.
- Be honest about the downsides. Every real decision costs something. If you can't name a cost, you probably haven't understood the trade-off yet.
- Keep it short. Link to the longer design document, the benchmark or the spike if there is one. The ADR is the summary that survives.
- Write for someone who wasn't there. Avoid "as discussed" and team nicknames for things. Spell out what the acronyms mean the first time.
Common mistakes
- Writing them after the fact, in bulk. A sprint spent "documenting all our decisions" produces a stack of records with thin context that nobody trusts. Start with the next decision instead. If you want to record a few old ones, pick the two or three people keep asking about.
- Editing accepted records. It feels tidy. It destroys the history. Supersede instead.
- Only listing the benefits. A record with no costs doesn't help anyone judge when to change it.
- Making the template too heavy. Fifteen mandatory sections and people stop writing them. Start with Nygard's three sections plus status, and add only what you keep missing.
- Treating ADRs as permission. An ADR records a decision the team made. It's not a way for one person to decide alone by getting the document in first. Proposed means proposed: it goes through review.
- Hiding them. A folder nobody knows about is the same as no folder. Link to it from the README, mention it in onboarding, and point to the ADR in code review when the question comes up.
What to try this week
- Add a
docs/adrfolder and a template to one repo you work on. The sections in this post are a fine starting point. - Write the next decision as an ADR. Not an old one. The next real choice your team makes, opened as a pull request with status Proposed.
- Pick the one decision people keep asking about and write it up, with whoever remembers the most, while they're still around.
- Add a "revisit if" line to that record. If you can't think of one, ask what would have to change for the decision to be wrong.
- Link the folder from the README so the next new hire finds it on day one.
The short version
- An ADR records one significant decision: title, status, context, decision, consequences. Usually one or two screens.
- Document the trade-off, not just the decision. Context and consequences, including the costs, are where the value is.
- List the options you rejected and why. That's what ends the "did anyone consider X?" conversation.
- Write one when a decision is hard to reverse or affects people outside the room. Skip it for things you could revert in an afternoon.
- Keep them in the repo, next to the code, and review them as pull requests.
- Never rewrite an accepted ADR. Supersede it with a new one and update the old one's status.
- Add a "revisit if" line, so the next team knows when the decision is open again.
Part 18 closes the series: preparing for the senior or staff engineer interview. A lot of those interviews ask you to walk through a past decision and its trade-offs, which is the same skill an ADR makes you practise every time you write one.
This is Part 17 of 18 in the series. The Senior Engineer Roadmap maps the whole series, with a short self-assessment and four reading orders.