
We've reached exactly 100 architecture decision records. An ADR is a short account of why we made a particular design choice. Most of ours are in the repository. The rest are still in my notebook, and I'll get those typed up too. Reaching a hundred seemed like a good occasion to explain why we keep them.
I'd like an engineer looking at one of my decisions a year from now to be able to make sense of it without having to find me. Even if I happen to be around, there's the small matter of how accurately I remember a conversation from a year ago. I usually remember what we decided. Why we gave up on the other option, the one everybody liked, takes a little more effort. That's when I go looking for the ADR myself.
Imagine you've been asked to change some purchasing software so that buyers can edit the amount on an approved request. You've found the check that prevents the edit. What was it put there for? Perhaps the head of purchasing signed off on a hundred thousand. It would be odd to let someone change that to a hundred and fifty thousand and leave the same signature underneath. Or perhaps the developers simply left editing for a later release. Either history could have produced the code in front of you.
What goes into a record
Each record has a number and a date. You can see who made the decision (the CEO, a developer, a tester, or everyone together during the discussion) and whether it still stands. For the substance of the record, I'd start with the question that made a choice necessary in the first place. What options did we have? What did each one buy us? What inconvenience were we willing to live with?
Suppose a team is considering whether to automate an occasional job. They leave it to an administrator and write up the decision as "We chose the simplest option." A year later, another engineer might reasonably ask, "Simplest for whom?" One detail would make that record considerably more useful. At the time, the administrator did the job once a month and could comfortably handle it by hand.
My favorite part of Michael Nygard's original ADR format is the section on consequences. He makes room for things the decision will make harder. The advantages are easy enough to recall after you've just spent a meeting arguing for your proposal. It's worth writing down the best objection, too, while the colleague who raised it can still look over your shoulder and say, "That wasn't quite my point." Michael Nygard, Documenting Architecture Decisions
In our own records we try to say what would prompt us to reconsider. One example comes straight from our work on Quevell. We decided an issue board would belong to a single project. The record also described a reason to revisit that choice. Someone might want to see issues from several projects on one board. The next day I asked for exactly that. The decision lasted a day, though the old record still explains why a single project originally seemed sufficient.
Why we go back to an old record
We go back to the ADR when it's time to check the implementation. We agree on the behavior we want to preserve and work out how to check it. Sometimes an automated test will do. Sometimes we need to see what happens on a running system. Think back to the purchasing example. If the team promised to preserve the amount the department head signed off on, open the approved version after an edit and read the amount under the signature. A test for a disabled Edit button answers a different question.
Another reason turns up much later. An engineer follows a link from an old issue to find out why part of the system still works the way it does. If we've since reversed our decision, the original record keeps its number and points to the new one. Between the two you can piece together what happened. If we rewrote the first record every time we changed our minds, we'd end up with the history of a team that saw everything coming. I'd be interested to meet that team.
Consider that hypothetical administrator again. Suppose the monthly job now comes up every day. The engineer proposing to automate it can look up why the team passed on automation the first time around. It might still cost too much to build, but nobody has to rely on memory for how often the administrator used to do the work.
That's what I want from my own ADRs. A year from now I'd much rather have a disagreement about the cost of a change than leave someone guessing what I meant.