Skip to content

Engineering habits · Part 8 of 10

Documentation that gets read, and architecture decision records

Write less, keep it close to the code and record decisions with their reasons in short ADRs. A README, a runbook and decision records cover most needs.

· 2 min read

engineeringdocumentation

Most documentation fails in two ways: it does not exist, or it is out of date and nobody trusts it. A small set of well-maintained documents beats a large wiki that rots.

Documents worth having

  1. README: what the project is, how to run it locally, how to test it, how to deploy. A newcomer should be productive within an hour.
  2. Runbooks: step-by-step instructions for operations, such as "restore the database" or "rotate the API key", written for someone stressed at night.
  3. Architecture overview: a short description with one diagram of the main parts and how data flows.
  4. Decision records: the reasons behind important choices.
  5. API docs, ideally generated from the code or the schema so they cannot drift.

Keep docs close to the code

Store documentation in the repository, review it in pull requests and update it in the same change as the code. Documentation that lives elsewhere is forgotten.

Architecture decision records

An ADR is a short file describing one decision. Code tells you what the system does, but not why that choice was made or what alternatives were rejected. A year later that reasoning is gone, and people either repeat old debates or fear changing anything.

Code
# ADR 007: Use PostgreSQL for background jobs

Status: accepted (2026-02-10)

## Context
We need a job queue. Adding a new broker means one more system to run.

## Decision
Use the existing PostgreSQL database as the queue for now.

## Consequences
+ No new infrastructure. Jobs can be enqueued inside a transaction.
- Throughput is limited. Revisit if we exceed a few hundred jobs per second.

Number them, never delete them, and when a decision changes, write a new ADR that supersedes the old one.

Writing tips

  • Start with the reader's question: "how do I deploy?", not the author's structure.
  • Prefer short sentences, examples and copy-pasteable commands.
  • Date things and name an owner.
  • Delete what is wrong. A short true document beats a long false one.

Takeaway

Keep a README, runbooks and ADRs in the repository, review them like code and always record the why.

A knowledge article, drafted with AI assistance and checked with automated tests. It is general background, not a description of my own experience or of any client's work.

Comments

Leave a comment

No account or email needed. Comments appear after review. A one-way hash of your IP address is kept for 30 days to fight spam, then erased.