This folder keeps smollerGraph's decision records: a page for each choice that shaped the database, with what forced it, what we picked, what else we weighed, and what it cost. They follow the format of the architecture decision records Michael Nygard described in 2011, in "Documenting Architecture
Decisions", kept short, with a section his doesn't have, for the alternatives considered.
Records 1 to 22 were written in episode 17, from what episodes 1 to 16 said and what their commits hold. Where an episode gave no reason for a choice, the record says so, rather than make one up after the fact.
Why keep them
The code says what the database does, and a commit says what changed. Neither says why it's this way and not another, and that's what gets lost first.
- The why survives the people who knew it. Why pages of 4 KiB, and why records that point at each other rather than Kùzu's columns, are in 0007 and 0003, with what was measured at the time and where.
- Newcomers learn the shape of the code. Read top to bottom, the records are the database's architecture in the order it was built, from a graph in memory to a model trained on it, each with the problem it answered.
- Settled questions stay settled. "Why not let the operating system cache the pages, with mmap?" has an answer in 0011, and asking again means saying what's changed since.
- Reversals are deliberate. Changing a decision takes a new record that says what's different now, as 0016 did for 0010 when the page met 21,834 taxa, and 0018 did for 0008 when the series stopped racing Neo4j and Kùzu.
When to write one
Write a record for a choice that would be costly to reverse, such as how the graph is laid out on disk, the query language, or how other programs reach the database, or one that people will ask about. A change that one commit could undo, or that the code makes plain, needs none.
How
- One file for each decision, named with the next number and a short title, such as
0025-a-short-title.md, from template.md, and headed with its number and title, such as # 25. A short title. Records 1 to 24 have a backslash before the dot, which the API docs leave out.
- The API docs publish the records, a page each, in the groups of the index below, and a link to this page from a record is
../decisions/README.md, as Doxygen takes a bare README.md to be the repository's.
- Its sections are the status, the context, with the episode it came up in, the decision, the alternatives considered, and the consequences. An alternative goes in only if it was weighed, or if it's the obvious one, and then it says it wasn't weighed. Name the files, the settings and the numbers, with where each number was measured: the episode, the data, and the machine when it matters.
- A record's status is
Proposed while it's discussed, Accepted once it's merged, and Superseded by a later record when one replaces it.
- An accepted record is never rewritten, like a published step (0005). To change a decision, write a new record, and set the old one's status to
Superseded by the new one. That line is the only edit an accepted record gets.
- Add it to the index below, in the group it's about, or in a new group if none fits.
Working with others
On a team, a record is where a choice gets argued before it's made, instead of after.
- Propose a decision in a pull request, with a new record whose status is
Proposed: on its own, before the code is written, or in the pull request that makes the change.
- The discussion happens in the record's review: the alternatives someone else would pick, and the numbers they'd want measured first. The record changes as the review goes, so it ends up saying what was weighed and why it lost.
- It becomes
Accepted when it's merged, with its status changed in the pull request's last commit.
- Someone new reads the records before asking why the code is the way it is. A question they don't answer is a record that's missing.
- Disagreeing with an accepted decision means proposing a record that supersedes it, and saying what's changed since: a new need, a new number, or a cost that showed up. If it's accepted, the old record's status becomes
Superseded by the new one in the same pull request.
Index
The records by what they're about, each group in the order they were written.