Guides

Architecture Decision Record (ADR) Template

Updated

Picture a payment service with a retry loop that waits exactly 41 seconds. Nobody on the team knows why. Two engineers spend a day arguing about whether to change it. They leave it alone, because the last person to touch it wrote a comment that says "do not change" and nothing else.

Eight months later someone finds the reason: the payment gateway times out at 40 seconds. A five-line record would have saved that day.

An architecture decision record (ADR) is that record. It is a one-page note: what was going on, what we chose, and what follows from it. Below is a template to paste into your repo, and how to keep records short enough that people write them.

When to write one

Write an ADR when a decision is expensive to reverse or will confuse the next person. If you could undo it in an afternoon, skip it.

  • Choosing or replacing a database, queue, framework or host
  • Drawing a boundary between services or modules
  • Picking an approach to authentication, data retention or deployment
  • Deciding not to do the obvious thing, such as skipping a cache or a rewrite

The five parts

Keep each record to one page. The context and the consequences carry the value.

  • Title: a short phrase that names the decision.
  • Status: proposed, accepted, or superseded by a later record.
  • Context: what forced the decision, including constraints you did not choose.
  • Decision: what you will do, in one or two sentences.
  • Consequences: what gets easier, what gets harder, and what to revisit.

Where to keep them

Keep them in the repo, next to the code. A folder like docs/decisions works, one Markdown file per decision, numbered in order. They get reviewed in pull requests and anyone who clones the project finds them.

Never edit an accepted record to change what it says. Write a new one that supersedes it and update the old status. The trail of changed minds is useful.

Why teams stop

Most teams stop for one reason. The record gets written after the fact, from memory, by someone who was not in the room. Write it while the decision is being made and attach it to the pull request that carries it out.

If your project has years of history and no records, rebuild the big ones from the change history. Look for large commits, dependency swaps and deleted modules. Write a short record for each.

Copy-paste ADR template

# ADR-0001: <short title of the decision>

Status: proposed | accepted | superseded by ADR-XXXX
Date: YYYY-MM-DD

## Context
What forced this decision? Include constraints, deadlines
and anything you did not get to choose.

## Decision
What we will do, in one or two sentences.

## Consequences
- What becomes easier
- What becomes harder
- What we will need to revisit, and when

Frequently asked questions

How long should an ADR be?

One page at most. If it needs more, you are probably recording several decisions. Split it.

Can I write ADRs for decisions made in the past?

Yes. Rebuild them from your change history and date the record the day you wrote it. A late record beats none.

Who approves an ADR?

The person who owns the area it affects. A pull request is a good place for it, since reviewers can accept the record together with the change.

Skip the manual work

Ask Jentic reads your change history and drafts decision records from it, so you don't start from a blank page.

More guides