Senior Engineering CraftVol. 24 · Craft
0 / 0

Shelves / Senior Engineering Craft

SC·04

Making Technical Decisions

How senior engineers decide well and fast enough: one-way and two-way doors, framing a decision with options and criteria, trade-offs between quality attributes, weighted decision matrices and the sensitivity check that keeps them honest, pre-mortems and second-order effects, build versus buy and "boring technology", experiments that buy information, architecture decision records, who decides and disagree-and-commit, and technical debt: what it is, how to measure its interest, and how to pay it down; with a lab that scores three designs and tests how fragile the winner is.

20 topics · ~10 min read · 16-question quiz
Updated Suggest a correction

Start here: a decision that hinged on one weight

Your squad must choose how kitchen reports get fresh order data: keep the nightly batch, add a message queue with application events, or use change data capture (CDC). You agree four criteria and weights, and score each option from 1 (poor) to 5 (good):

Criterion Weight Nightly batch Message queue CDC
freshness 0.35 2 4 5
operational simplicity 0.25 5 3 3
low change effort 0.20 5 2 3
future flexibility 0.20 3 4 5
weighted score 3.55 3.35 4.10

CDC wins. But the weights are judgments, so the lab tested them: it varied every weight randomly by up to ±50% (10,000 times), and also halved or raised each weight by half on its own.

  • CDC still won in 93% of random variations; the batch won the other 7%.
  • Halving freshness's weight shrank CDC's lead to 0.03, essentially a tie with the batch. No other single change came close.

So the honest summary isn't "CDC scores 4.10". It's: "CDC is the better choice if fresh reports matter as much as we think; if freshness is only a nice-to-have, keep the batch." That turns a scoring exercise into the one question worth asking the head of operations.

How deep to go

Volume 17 defines six mastery levels. For technical decisions:

Level What you can do
L1 Explain the reasons for decisions in your own code
L2 Compare two options with explicit trade-offs
L3 Frame and make team-level decisions; write ADRs; distinguish reversible from irreversible choices
L4 Run decisions with stakeholders, including sensitivity checks and pre-mortems; manage technical debt deliberately
L5 Set architectural direction for a domain; build vs buy; multi-year migrations
L6 Make and explain organisation-wide technology bets

Reversibility sets the process

Amazon's 2015 shareholder letter popularised a useful split:

Two-way door One-way door
reversal cheap and quick expensive or impossible
examples internal library choice, UI layout, a feature behind a flag, a config value public API contracts, database and data-model choices, data deletion, long vendor contracts, programming language of a large system
process decide quickly, small group, experiment, watch metrics write it down, consult widely, consider alternatives carefully, plan the migration path

Most decisions are two-way doors, and treating them as one-way doors slows a team to a crawl. A senior engineer's skill is recognising the few one-way doors, and making decisions more reversible: feature flags, interfaces around vendors, expand-and-contract schema changes (Volume 6), keeping old paths until the new ones are proven.

The cost of delay matters too: an imperfect decision now often beats a perfect one in a month, if it's reversible.

Framing the decision

Most bad decisions are bad framings. Before comparing options, write down:

  1. The question, precisely: "How do kitchen reports get order data within a minute?" not "Should we use Kafka?"
  2. Constraints: deadlines, budget, skills, compliance, existing systems.
  3. Options: at least three, including "do nothing" and the simplest thing; look for options that combine others.
  4. Criteria that matter for this decision, from the goals and quality attributes (performance, reliability, operability, security, cost, time to market, team familiarity, flexibility).
  5. Who decides, who's consulted, by when.

Trade-offs are the substance

Every option is a trade-off among quality attributes: consistency vs availability (Volume 5), latency vs cost, flexibility vs simplicity, speed now vs ease of change later. Make them explicit. "CDC gives sub-minute freshness at the cost of running Debezium and coupling reports to the table schema" is a decision someone can agree or disagree with; "CDC is the modern approach" isn't.

Tools for deciding

Weighted decision matrix, with sensitivity

A matrix (criteria × options, weights, scores) structures discussion and records reasoning. Its danger is false precision. Always:

  • agree criteria and weights before scoring, ideally with stakeholders;
  • score with evidence, noting where scores are guesses;
  • check sensitivity: vary weights and uncertain scores and see whether the winner changes (the lab);
  • report the hinge: the judgment the decision depends on.

If small changes flip the result, the options are close; pick the more reversible one, or run an experiment.

Pre-mortem

Gary Klein's technique: "It's six months from now and the CDC project failed. Write down why." Each person writes privately, then the group shares and ranks. It legitimises doubt and surfaces risks (slot lag filling the disk, nobody owning Debezium, schema changes breaking consumers) while there's time to mitigate.

Second-order effects

Ask "and then what?": a new queue means a new on-call rotation, new dashboards, new failure modes, training, and a component that every future engineer must learn. Most of a technology's cost arrives after adoption.

Experiments and prototypes

When the decision hinges on an unknown ("can CDC handle our peak write rate?"), buy information: a spike, a load test, a prototype, a shadow deployment. A two-day experiment that settles a question beats two weeks of debate.

Build, buy or adopt

Option Good when Watch for
build it's core to what makes you different, or nothing fits ongoing maintenance, on-call and staff cost forever
buy (SaaS/vendor) it's undifferentiated (payments, email, auth, monitoring) and a vendor does it better lock-in, pricing changes, data location (Volume 23), vendor reliability, exit cost
adopt open source a mature project fits maintenance health, licence, your ability to operate and patch it

Compare total cost of ownership over several years (licences + engineering time + operations + migration), not sticker price. For buy decisions, design an interface that would let you switch, and know your exit plan.

Choose boring technology (Dan McKinley's essay): each team has a few "innovation tokens"; spend them where new technology brings a real advantage and use proven, well-understood tools elsewhere. The known failure modes of PostgreSQL are a feature.

Recording decisions: ADRs

An architecture decision record (Michael Nygard's 2011 format) is a short Markdown file kept in the repository:

Text
# ADR 0017: Use change data capture for order events

Status: accepted (2026-11-14)    Supersedes: ADR 0009
Context: Kitchen reports refresh nightly; 31% of support tickets ask about missing orders.
         Options: 5-minute batch, application events via outbox, CDC (Debezium). ...
Decision: Use Debezium CDC on the orders table into Kafka; consumers upsert by order ID and version.
Consequences: + sub-minute freshness, no service code changes
              − platform team runs Debezium; reports coupled to the orders schema (schema registry required)
              Revisit if write volume exceeds 5,000 orders/s or a second consumer needs domain events.

ADRs are immutable: when a decision changes, write a new ADR that supersedes the old one. Over time they become the system's history of reasoning, invaluable for new engineers (chapter 05) and for revisiting decisions intelligently.

Who decides

Make decision rights explicit for anything contentious. Frameworks such as RACI (responsible, accountable, consulted, informed) or DACI (driver, approver, contributors, informed) name who drives, who approves and who must be consulted. Then:

  • Consult genuinely, early enough that input can change the result.
  • Decide within the agreed time, even with incomplete information; record the reasoning.
  • Disagree and commit: argue your case fully; once a decision is made, support it wholeheartedly, and revisit only with new information, through the same process. Quietly undermining a decision is worse than either option.
  • Escalate cleanly when peers can't agree: a short, fair summary of the options and trade-offs, written together.

Technical debt

Ward Cunningham coined the metaphor: shipping code that isn't quite right is like borrowing money; you go faster now and pay interest later in every change that touches it, until you pay down the principal by fixing it.

Martin Fowler's debt quadrant distinguishes:

Reckless Prudent
deliberate "We don't have time for design" "We must ship now and will deal with the consequences" (with a plan)
inadvertent "What's layering?" "Now we know how we should have done it"

Prudent, deliberate debt is a legitimate tool. The others need prevention (skills, review) or are simply the result of learning.

Managing it:

  • Make it visible: a debt register (or labelled tickets) describing each item's interest: which changes it slows, which incidents it causes, how often that code changes.
  • Prioritise by interest: debt in code that changes weekly is expensive; debt in stable code nobody touches can often stay. Change frequency from git history plus incident data is a good guide.
  • Pay down continuously: improve code in the area you're already changing (the "boy scout rule"), and reserve a steady share of capacity for larger items rather than waiting for a "cleanup quarter" that never comes. The right share depends on the codebase's state; make it explicit with your product partners.
  • Big migrations incrementally: the strangler fig pattern routes one piece at a time to the new system until the old can be removed; set an end date and actually remove the old path.
  • Explain debt in business terms: "every change to the pricing module takes three days instead of one, and it caused two of last quarter's five incidents".

Common traps

  • Treating every decision as a one-way door, or a real one-way door as trivial.
  • Framing a decision as a technology choice instead of a problem.
  • Fewer than three options, or no "do nothing".
  • A decision matrix without a sensitivity check.
  • Choosing exciting technology for its own sake.
  • Decisions without records, relitigated every few months.
  • Disagreeing after the decision instead of during it.
  • Debt discussed only as complaints, never as interest and priority.

Lab: how fragile is the winner?

Setup. A Python 3.13 script (standard library only, fixed seed) computes weighted scores for three options against four criteria, using the weights and 1–5 scores from the start of the chapter, which are illustrative judgments rather than measurements. It then runs two sensitivity checks: (1) 10,000 random variations in which every weight is multiplied by a random factor between 0.5 and 1.5 and the weights are renormalised to sum to 1; (2) one weight at a time multiplied by 0.5 or 1.5 (then renormalised), recording the winner and its margin over the runner-up.

Results: base case

Option Weighted score
CDC (Debezium) 4.10
nightly batch (keep) 3.55
message queue 3.35

Results: sensitivity

  • Random ±50% weight changes: CDC won 93%, nightly batch 7%, message queue never.
Weight changed ×0.5: winner (margin) ×1.5: winner (margin)
freshness CDC (0.03) CDC (0.79)
operational simplicity CDC (0.86) CDC (0.27)
change effort CDC (0.72) CDC (0.32)
future flexibility CDC (0.39) CDC (0.68)

What it shows

  • The result is fairly robust to imprecise weights: CDC wins in most plausible variations.
  • One judgment carries the decision: how much freshness matters. Halving it produces a near-tie with doing nothing.
  • Sensitivity analysis turns a number into a question for the right person ("How much is sub-minute freshness worth to kitchens?"), which is more useful than the score itself.
  • The message queue never wins under these criteria, so it can be dropped from discussion, unless a criterion is missing (for example, "other teams need domain events"), which is the next thing to check.

Try it yourself

  1. Add a criterion, "other teams can consume order events", weighted 0.15, and score it. Does the queue become competitive?
  2. Make the scores uncertain too (±1 point at random) and rerun the random variation.
  3. Use the matrix for a real decision on your team; ask two colleagues to set weights independently first and compare.
  4. Run a 20-minute pre-mortem for a project starting soon and write the top three risks into its design doc.
  5. Write an ADR for a decision your team made in the last month but didn't record.

Revision sheet: making technical decisions

Key ideas

  • Reversibility sets the process: decide two-way doors quickly; take care with one-way doors; make decisions more reversible.
  • Frame: precise question, constraints, three or more options including "do nothing", criteria, decider and deadline.
  • Trade-offs between quality attributes are the substance; state them plainly.
  • Decision matrices need agreed weights, evidence and a sensitivity check; report the hinge.
  • Pre-mortems, second-order effects and experiments reduce risk and uncertainty.
  • Build vs buy vs adopt by total cost of ownership and differentiation; choose boring technology; plan exits.
  • ADRs record context, decision and consequences; superseded, never edited.
  • Explicit decision rights (RACI/DACI); consult early; disagree and commit; escalate with a joint summary.
  • Technical debt: interest vs principal; Fowler's quadrant; register, prioritise by interest, pay down continuously, migrate with the strangler fig.

Numbers to remember

  • Lab: CDC won 93% of random weight variations; halving freshness left a 0.03 margin.

Glossary

  • One-way / two-way door: irreversible / reversible decision.
  • Cost of delay: value lost by deciding later.
  • Sensitivity analysis: testing how results change with inputs.
  • Pre-mortem: imagining failure in advance.
  • TCO: total cost of ownership.
  • ADR: architecture decision record.
  • DACI / RACI: decision-rights frameworks.
  • Strangler fig: incremental replacement of a system.