Why we write the runbook before the code

Novistack Studio

5 min read

A folded sheet of white paper casting a long soft shadow across a pale blue background.

A runbook written before launch changes the architecture. That is the point of writing it early.


The document nobody wants to write

Runbooks are usually written at the end, by whoever is least able to say no, in the week everyone is already tired. They describe what the system does rather than what to do when it stops doing it.

We write ours during architecture. Before the first endpoint exists, we write the paragraph that begins: at 3am, this alert fires, and here is what the person on call should try first.

Start with the day after launch

The exercise is uncomfortable in a useful way. If the honest answer to an alert is 'wake up the person who wrote it', you have designed a dependency on an individual. If the answer is 'restart the worker and read the queue depth', you have a system.

Writing this down early surfaces decisions that are cheap to change in week one and expensive to change in month six: where state lives, what is idempotent, which failures are allowed to be loud.

What goes in it

A short map of the system and the three things that must stay true for it to work. The alerts that actually page someone, with the first three checks for each. The safe way to roll back, tested once while calm. And who to call, with a name rather than a team alias.

It should fit on two screens. A long runbook is a sign the system has more failure modes than the team can hold, which is worth knowing before launch rather than after.

The side effect: better architecture

The document changes the code because it forces you to imagine the failure as a person, not a diagram. Features get smaller. Recovery gets simpler. Deploys get boring, which is the highest compliment available to a deploy.

It also changes the handover conversation. Instead of promising that everything will be fine, we can show the new owner exactly what to do when it isn't.