Architectural Thinking — Forces, Scenarios & Trade-offs›05 · Trade-offs, reversibility and ADRs

Lesson 05 of 5 · Targets and decisions

Trade-offs, reversibility and ADRs

Make trade-offs explicit and decisions auditable. Classify decisions by reversibility, keep options open until the last responsible moment, record decisions as ADRs with alternatives and consequences, and use a weighted decision matrix with a sensitivity check (runnable, with real output) to find out what a decision actually depends on.

Advanced
Key wordstrade-off analysisone-way doortwo-way doorreversibilityoption valuelast responsible momentarchitecture decision recordADRMADRweighted decision matrixsensitivity analysisfitness functions

Forces

Every architecture decision gives something up. A review that hears only the benefits of the chosen option has not seen a decision; it has seen a sales pitch. The value an experienced architect adds is naming what is lost, how likely it is to matter, and how expensive it would be to change course.

The forces: speed of decision against quality of decision, and the organisation's memory against its turnover. Decisions made quickly and never written down get re-argued every time someone new joins, and get silently reversed by people who never knew why they were made.

First principles

Reversibility

Jeff Bezos's 2015 shareholder letter split decisions into two types. Type 1 decisions are one-way doors: consequential and nearly irreversible, to be made slowly and carefully. Type 2 decisions are two-way doors: if you're wrong, you walk back through, so they should be made quickly by small groups. The failure he warned about is treating Type 2 decisions with Type 1 process, which makes the organisation slow.

For architecture, reversibility is rarely binary. Estimate it:

Question Pushes towards one-way
Does data get written in a format or location that is hard to move? Yes
Do external clients integrate with it? Yes
Does it shape team boundaries or hiring? Yes
Does a contract or regulator depend on it? Yes
Can it be hidden behind an interface you own? No
TWO-WAY DOOR: decide fast ONE-WAY DOOR: decide slowly test framework internal library service boundary event schema tenancy model data residency One-way decision e.g. public event schema Add something you own interface · router · versioned format Two-way door run old and new side by side pay a little now to keep the right to change your mind
Most decisions sit somewhere between the doors. Owning an interface, a router or a versioned format moves a decision to the left.

A strong design move is to convert one-way doors into two-way doors: put the datastore behind a repository interface, version the event schema from day one, route tenants through a router you control so placement can change later. Each conversion costs something now, and buys the right to change your mind.

Option value and the last responsible moment

An unmade decision has value: it keeps options open while you learn. Lean software development calls the right time to decide the last responsible moment: the point after which not deciding removes an important option or causes delay. Deciding earlier throws away information you would have had; deciding later lets the decision be made for you by default. For each significant decision, ask what you would learn by waiting, and what waiting costs.

What a trade-off statement contains

A complete trade-off has four parts:

  1. What we gain, in terms of a quality-attribute scenario.
  2. What we give up, in the same terms.
  3. Under what conditions the loss starts to matter (load, team size, regulatory change).
  4. How we would notice, and what we would do then.

"We chose local policy evaluation: decision p99 drops from 9 ms to under 1 ms; revocation latency rises from under 1 s to up to 5 s at peak push lag; this matters if a customer's contract requires sub-second revocation; we alert on push lag above 2 s, and the central path remains available as a fallback for high-risk actions."

Architecture decision records

Michael Nygard proposed ADRs in 2011: short documents, one per decision, kept with the code, never deleted, only superseded. The original structure:

# ADR-0007: Evaluate authorisation policy locally in each service

Status:       Accepted (2026-11-18). Supersedes ADR-0003.
Context:      30 services call the central decision API on every request. Measured p99
              is 9 ms, 40% of the budget for the read path. Revocation must take
              effect within 2 s (scenario SEC-2). The central API is a hard dependency
              for every product.
Decision:     Each service evaluates policy with an embedded engine against data pushed
              from the policy store. High-risk actions (list in appendix) still call the
              central API.
Alternatives: (A) keep central API and cache decisions for 5 s: rejected, breaks SEC-2.
              (C) claims in 15-minute JWTs: rejected, revocation up to 15 min.
Consequences: + decision p99 < 1 ms; central API no longer a hard dependency for reads
              - revocation now bounded by push lag (target p99 < 2 s, alert at 2 s)
              - policy engine version must be kept consistent across 30 services
              - adds a push pipeline to operate
Revisit when: push lag p99 > 2 s for a week, or a contract requires < 1 s revocation.

Variants such as MADR add an explicit list of decision drivers and a pros-and-cons table per option. Use whichever your organisation will actually keep up. The two fields people skip, and shouldn't, are alternatives considered (so nobody reopens the debate without new information) and revisit when (so the decision can be revisited deliberately, not by accident).

Fitness functions

Building Evolutionary Architectures (Ford, Parsons, Kua) proposes architectural fitness functions: automated checks that a decision is still holding. A dependency rule in CI ("the billing module may not import the identity module"), a latency test in the pipeline, an alert on push lag. They turn the "how we would notice" part of a trade-off into code.

Design space

Practice Good for Weakness
ADR per significant decision Memory, onboarding, accountability Decays if nobody reviews them
Weighted decision matrix Making criteria and weights explicit False precision; scores are opinions
Spike or prototype Replacing an opinion with a measurement Time; prototypes become production
Pre-mortem ("it's a year later and this failed; why?") Surfacing risks people won't volunteer Needs psychological safety
Two-way-door conversion (interfaces, routers, versioning) Keeping options open Upfront cost, indirection
Fitness functions Detecting when a decision stops holding Needs ownership to keep them green

Failure modes

  • Decision amnesia. The reason is lost, so the decision is re-argued or silently undone.
  • One option presented. A design doc with no alternatives is a request for approval, not an evaluation.
  • Matrix theatre. Weights adjusted until the preferred option wins.
  • Everything treated as a one-way door. Every choice goes to a committee; teams stop making decisions.
  • No revisit trigger. A decision that was right at 1,000 tenants is defended at 50,000 because nobody wrote down when it should be checked.

Published incident: Cloudflare, 2 July 2019

Cloudflare deployed a new Web Application Firewall rule containing a regular expression that backtracked catastrophically. It consumed all CPU on the machines that serve HTTP traffic across the global network, and traffic dropped for about 27 minutes. The post-mortem explains a deliberate trade-off: WAF rules were pushed to the whole network within seconds, because responding quickly to new attacks was the product's value, while software releases went through staged rollouts. The trade-off was reasonable for its gain and had no protection against its loss: a rule that broke the machines it ran on. Afterwards Cloudflare added staged rollouts for rules, re-introduced CPU limits for rule execution, and changed the regex engine to one with run-time guarantees. Lesson: when you choose speed over safety for a class of change, say what protects you from the worst outcome, and test that protection.

Lab: a decision matrix that tells you what you really think

Three ways to make authorisation decisions in a SaaS product, scored 1-5 on five weighted criteria. The script ranks them, then moves 0.10 of weight between every pair of criteria to see whether the winner changes. Save it as decide.py and run it with Python 3.

#!/usr/bin/env python3
"""Weighted decision matrix with a sensitivity check. Scores 1-5, higher is better."""
criteria = {"revocation latency": 0.30, "decision p99": 0.25, "operability": 0.20,
            "cost": 0.15, "reversibility": 0.10}
options = {
    "A central decision service":       {"revocation latency": 5, "decision p99": 2, "operability": 4, "cost": 4, "reversibility": 4},
    "B local evaluation + push":        {"revocation latency": 4, "decision p99": 5, "operability": 3, "cost": 3, "reversibility": 3},
    "C JWT claims, 15-min tokens":      {"revocation latency": 1, "decision p99": 5, "operability": 5, "cost": 5, "reversibility": 2},
}

def total(scores, w):
    return sum(w[c] * scores[c] for c in w)

def ranking(w):
    return sorted(options, key=lambda o: total(options[o], w), reverse=True)

print("weighted totals")
for o in ranking(criteria):
    print(f"  {total(options[o], criteria):4.2f}  {o}")

print("\nsensitivity: move 0.10 of weight from one criterion to another; does the winner change?")
base = ranking(criteria)[0]
flips = 0
for a in criteria:
    for b in criteria:
        if a == b or criteria[a] < 0.10:
            continue
        w = dict(criteria); w[a] -= 0.10; w[b] += 0.10
        win = ranking(w)[0]
        if win != base:
            flips += 1
            print(f"  {a} -> {b}: winner becomes {win}")
print(f"  {flips} of 20 shifts change the winner (base winner: {base})")

Output from a real run (Python 3, macOS):

weighted totals
  3.80  A central decision service
  3.80  B local evaluation + push
  3.50  C JWT claims, 15-min tokens

sensitivity: move 0.10 of weight from one criterion to another; does the winner change?
  revocation latency -> decision p99: winner becomes C JWT claims, 15-min tokens
  revocation latency -> operability: winner becomes C JWT claims, 15-min tokens
  revocation latency -> cost: winner becomes C JWT claims, 15-min tokens
  operability -> revocation latency: winner becomes B local evaluation + push
  operability -> decision p99: winner becomes B local evaluation + push
  operability -> reversibility: winner becomes B local evaluation + push
  cost -> revocation latency: winner becomes B local evaluation + push
  cost -> decision p99: winner becomes B local evaluation + push
  cost -> operability: winner becomes B local evaluation + push
  cost -> reversibility: winner becomes B local evaluation + push
  reversibility -> revocation latency: winner becomes B local evaluation + push
  reversibility -> decision p99: winner becomes B local evaluation + push
  reversibility -> operability: winner becomes B local evaluation + push
  reversibility -> cost: winner becomes B local evaluation + push
  14 of 20 shifts change the winner (base winner: A central decision service)

What to read from it:

  • A tie. A and B both score 3.80, and the "winner" is just whichever is listed first. The matrix has not made a decision; it has shown that the decision isn't made yet.
  • The decision is fragile. 14 of 20 small weight shifts change the winner. Any reviewer who cares 10% more about operability, cost or reversibility will pick B. Anyone who cares 10% less about revocation latency will pick C, the option that breaks the 2-second revocation scenario.
  • The real driver is one requirement. Option C only wins when revocation latency loses weight. That tells you the requirement must be confirmed in writing before anything else, because the whole decision depends on it.

Exercises:

  1. Replace the opinions with measurements: what spike would turn B's "decision p99" and "revocation latency" scores into numbers?
  2. Add a "security blast radius" criterion. How would you score each option, and does it break the tie?
  3. Write the ADR for the option you would choose, with a "revisit when" line that a fitness function could check.

Architect's lens

From the ten questions, this lesson operates on change (which decisions are one-way doors) and closes every design: the two or three key trade-offs, stated in the four-part form, the biggest risk, and what to build first. A design review should leave behind ADRs, not just slides.

Design review

Brief. A team proposes moving from a shared PostgreSQL cluster to a database per service for 14 services, over two quarters, to remove coupling. Two services join across each other's tables today. The platform team runs the shared cluster with one DBA.

Produce: the decision classified by reversibility (and which parts could be made two-way); at least three alternatives including "don't"; a weighted matrix with a sensitivity check; the ADR; the fitness functions that would tell you it's working; and the sequencing plan.

Level What the answer shows
Senior Alternatives listed and a reasoned choice
Staff Reversibility analysed; intermediate steps (schema per service, ownership per table, no new cross-service joins) proposed as two-way doors before the one-way split
Principal The operating-model cost (one DBA, 14 databases) and the organisational change stated; the decision tied to a measured problem; revisit triggers and fitness functions defined; what you would not do

Self-check

Name two ways to turn a one-way door into a two-way door.

Put the decision behind an interface you own (a repository layer, a tenant router), and version formats from day one (event schemas, API versions), so you can run old and new side by side.

Which two ADR fields are most often skipped, and why do they matter?

Alternatives considered (stops the same debate being reopened without new information) and revisit when (makes the decision checkable later instead of defended forever).

Your matrix gives a clear winner, but a 10% weight shift flips it. What do you conclude?

The decision depends on that weight. Confirm the underlying requirement with its owner, or replace scores with measurements, before deciding.

References

  • Nygard, "Documenting Architecture Decisions", 2011
  • MADR (Markdown Any Decision Records) template, adr.github.io
  • Bezos, letter to Amazon shareholders, 2015 (Type 1 and Type 2 decisions)
  • Poppendieck and Poppendieck, Lean Software Development, 2003 (last responsible moment)
  • Ford, Parsons, Kua and Sadalage, Building Evolutionary Architectures, 2nd edition, 2022
  • Cloudflare blog, "Details of the Cloudflare outage on July 2, 2019"

This site is a public version of my personal engineering knowledge hub. It intentionally excludes confidential company information and internal operational details.