Code records what a system does. It rarely records why it was built that way, and that is the part that is lost first.
01 · The gap
Six months later, the reason is the missing piece.
A new team member finds an odd design and either leaves it alone out of fear or removes it out of confidence. Both can be wrong, because the reason it exists was never written down.
Commit messages explain a change. Documentation explains how to use something. Neither reliably says which options were considered and why this one won.
02 · The record
One short page per significant decision.
This is the shape of an architecture decision record. It is short on purpose: a page that takes ten minutes to write actually gets written.
- ContextWhat problem forced a choice, and what constraints applied at the time.
- OptionsThe realistic alternatives, including the ones that were rejected, in a sentence each.
- DecisionWhat was chosen, stated plainly.
- ConsequencesWhat becomes easier, what becomes harder, and what is now accepted as a risk.
03 · What makes one good
Honest about the trade-off, and tied to the date.
A record that lists only the benefits of the choice is advertising. The useful part is the cost that was knowingly accepted, because that is what someone will want to revisit when circumstances change.
Record the date and the status. A decision can later be superseded, and the old record should say so and point to the new one, rather than being deleted. The history of the thinking is part of the value.
Write down the option you did not choose. It is the first thing a future reader will ask about.
04 · Keeping it light
Store them with the code, and write them at the time.
Keep records in the repository, in plain text, so they travel with the code and show up in review. Write them when the decision is made, while the reasons are fresh. A record reconstructed a year later is mostly guesswork.
Not every choice needs one. A good test is whether the decision would be expensive to reverse, or surprising to a newcomer.
05 · Worked example
What a good short record looks like.
This is an invented example, to show the shape. Title: use a managed queue for report requests. Status: accepted, 14 March. Context: report requests arrive in bursts and the web server timed out while generating them. Options: generate on the request, run a nightly batch, or queue and process in the background. Decision: queue and process in the background. Consequences: users wait for an email instead of a page; we now need to monitor the queue and handle failed jobs; nightly batches were rejected because users need same-day reports.
It is under a page, and a newcomer reading it a year later knows what was chosen, what was given up and what was rejected.
06 · Pitfalls
Why decision records fail.
- Writing them afterwardsReasons are forgotten within weeks. Write the record in the same session as the decision.
- Making them longA record nobody wants to write does not get written. One page is plenty.
- Leaving out the alternativesThe rejected options are the first thing a future reader will ask about.
- Deleting old onesMark a record as superseded and link to the new one. The path of the thinking is the value.
- Storing them somewhere separateKeep them in the repository, beside the code, so they are found and reviewed with it.
What I took away
- Record the why: context, options, decision and consequences.
- State the cost that was accepted, and the options that were rejected.
- Keep records beside the code, dated, and supersede rather than delete.