Skip to content

Architecture Documentation, ADRs, and Runbooks ​

Documentation explains how a system works, why a decision was made, and what to do first during an outage. Diagram freshness, decision records, and operational procedures should share one ownership model.

Quick Decision ​

NeedDocumentWatch out
Explain system boundariesContext/container/component diagramInclude source and review date
Explain request or event flowSequence/data-flow diagramShow sync/async boundaries
Record an architecture choiceADRState decision, alternatives, and outcome
Repeat an operation safelyRunbookInclude preconditions, commands, rollback
Catalog servicesService mapOwner, SLO, dependencies, and data owner

Production Checklist ​

  • Problem: Which decision or operational step does the document accelerate?
  • Solution: Are owner, audience, scope, last-reviewed date, and source of truth clear?
  • Trade-off: Detailed documentation is valuable; stale documentation creates false confidence.
  • Failure mode: Handle stale diagrams, missing rollback, wrong alert steps, and hidden dependencies.
  • Measurement: Track ADR review age, runbook success, incident MTTR, and broken links.
  • Security/cost: Do not put secrets, private endpoints, or customer data in documents.

Architecture Views ​

Maintain these views when needed:

  • Context: Users, external systems, and system boundary.
  • Container/service: Services, queues, databases, caches, and ownership.
  • Component: Modules inside a critical service and dependency direction.
  • Sequence: Success, error/retry, async completion, and failover flows.
  • Data flow: Movement from source of truth to projections, cache, backups, or analytics.

Every arrow should be meaningful through a protocol or event name, timeout/retry boundary, and failure boundary. Keep Mermaid diagrams easy to update; reduce drift with diagrams-as-code or source links when infrastructure changes.

Service Map and API Catalog ​

A service map should show owner/team, repository, runtime, region, SLO, data owner, inbound/outbound dependencies, auth method, deployment method, and alert links. An API catalog adds endpoint/schema owner, lifecycle, version, rate limits, examples, and deprecation date.

Use the same service ID across API Contracts and Tooling, observability, and incident processes.

ADR Format ​

An ADR is a short, durable decision record:

text
# ADR-0042: Use a queue for order completion
Status: Accepted
Date: 2026-09-03
Context: The work exceeds the request latency budget.
Decision: Use queue + worker + job status.
Alternatives: Synchronous call, scheduled batch
Consequences: Eventual consistency, retry, and DLQ operations

An ADR is not a copy of the implementation or a long tutorial. Its status may evolve through proposed, accepted, deprecated, and superseded; link a new decision rather than silently deleting the old one.

Runbook Design ​

Every runbook should follow this order:

  1. Impact: Which users, SLO, or region is affected?
  2. Signal: Where are the alert, dashboard, logs, and traces?
  3. Safety: Authorization, blast radius, maintenance window, and stop conditions.
  4. Diagnosis: Lowest-risk checks first.
  5. Mitigation: Actions and expected signals.
  6. Recovery: Rollback, replay, failover, or traffic shift.
  7. Verification: Validate SLO, errors, queue age, and user flow.
  8. Follow-up: Incident record, ADR, or permanent fix.

Use placeholders and dry-run output for commands; never include passwords, tokens, or broad destructive commands. Exercise runbooks regularly with production access owners.

Lifecycle ​

A code or infrastructure change should update its diagram, service map, ADR, or runbook in the same review. Quarterly reviews, post-incident validation, and broken-link checks reduce stale documents. Remove documents that no longer carry decision or operational value after cleaning their links.

Created by Eren Demir.