Skip to content
Lesson 44

Engineering trade-offs

Two good designs, one decision. Turn "it depends" into numbers, price every option all in, let hard requirements remove options, and match the effort to how hard the decision is to undo.

The lesson in text

Click a paragraph to hear it.

01Two good designs

Tuesday morning. StayHub's booking path runs in one cloud region, Frankfurt, spread over three availability zones: separate data centres, a few kilometres apart.

Karim, the CTO, wants a full second region for the whole platform by summer. It adds €29,000 a month. His reason: a region outage would stop every booking.

Omar, who runs on-call, wants nothing new. A second region doubles what can break at three in the morning. He'd rather keep fewer moving parts.

Both designs carry the traffic. Both people are careful, about different things. So which one is right? That's what senior engineering mostly is: choosing well between two good options.

02It depends, on what?

A trade-off means every option buys something by giving something else up. More resilience costs money and complexity. Less complexity costs resilience. No option wins on everything.

So the honest answer is often: it depends. But "it depends" only helps if you can say on what. On the cost of an hour without bookings. On what a contract requires. On the team's time.

Here's a method for every big choice. The problem. The requirements, in numbers. The constraints. The options. What each one gives up. And the decision, written down.

The decision method, applied to the second region
StepFor the booking path
1. ProblemA region outage stops bookings for hours (not "we need a second region": that's a solution)
2. Requirements, in numbersAn hour of downtime costs ~€20,000; a partner needs tested recovery within 1 hour; no lost bookings; data stays in the EU
3. ConstraintsOne on-call team, already busy; writing in two regions risks selling a room twice
4. OptionsStay as we are · warm standby for the booking path · whole platform active-active
5. What each gives upMoney, complexity, recovery time, drills
6. Decision, written downAn ADR with the numbers and a "revisit when" trigger
"It depends" is honest only when you can say on what. The requirements line is where adjectives become numbers.

Start with the problem, not a solution. Saying "we need a second region" is already an answer. The problem is: a region outage stops bookings for hours. Said that way, cheaper answers can enter the room.

03A second region is insurance

Think of a second region as insurance. The monthly cost is the premium. You pay it every month, and most months, nothing happens.

You don't buy insurance because disasters are scary. You buy it when the loss you expect is bigger than the premium, or when there's a loss you simply can't afford.

The expected loss is how often the bad thing happens, times what it costs when it does. That's a number you can compare with an invoice.

And one more check that people forget: does the policy actually pay out? A policy you've never tested is just a monthly bill.

04Price the risk

So what does an hour without bookings cost? StayHub takes about 100,000 bookings a day, and earns about €4.70 of commission on each. That's €470,000 a day, about €20,000 an hour.

How often does a whole region fail? About once every two years, for about eight hours. That's four hours a year, on average.

Four hours times €20,000: the expected loss is about €80,000 a year. Karim's full second region costs €348,000 a year. On downtime alone, the premium is more than four times the loss it prevents.

Expected loss: how often × what it costs
~100,000 bookings a day × ~€4.70 commission= €470,000 a day ≈ €20,000 an hour
One ~8-hour region outage every 2 years= 4 hours a year on average
4 hours × €20,000≈ €80,000 a year of expected loss
Full second region: €29,000 × 12= €348,000 a year of premium
Like insurance: compare the yearly premium with the loss you expect. On downtime alone, the full second region costs more than four times what it prevents.

Notice what just happened. Nobody said Karim was wrong to worry. We just put both sides of the argument in the same unit.

05Three options, priced all in

Now three options, each priced all in: what you pay, plus the outages you still expect. Option one: stay as we are. No extra cost, about €80,000 a year of expected downtime. The cheapest, on paper.

Option two: a warm standby, a copy of the booking path in a second region, kept up to date and ready to take over in about thirty minutes. €9,000 a month, plus about €5,000 of expected downtime: about €113,000 a year.

Option three, Karim's: active-active, the whole platform running in both regions at once. Recovery in minutes, about €350,000 a year. And writing bookings in two places at once adds a new risk: the same room sold twice.

Three options, priced all in (booking path)
OptionExtra cost / yearRecoveryExpected downtime / yearAll in / yearRecovery ≤ 1 h?
1. Stay as we are€0~8 h~€80,000~€80,000No
2. Warm standby, booking path only€108,000~30 min~€5,000~€113,000Yes
3. Active-active, whole platform€348,000minutes~€2,500~€350,000Yes
Option 2 over option 1: ~€33,000 a year to keep a partner worth ~€1.2 million. Option 3 over option 2: ~€240,000 a year to save ~€2,500, plus the risk of selling a room twice.
All in = what you pay + the outages you still expect. A hard requirement removes options before the price comparison; then the cheapest option that passes wins.

Put side by side, option three costs about €240,000 a year more than option two, to save about €2,500 of downtime. That's an expensive way to buy a few minutes.

06The requirement you can't trade

So should we stay as we are? Not so fast. A corporate travel company, worth about €1.2 million a year in commission, requires a tested recovery plan: back up within one hour.

Option one recovers in about eight hours. It fails that requirement, so it's out, before any price comparison. A hard requirement isn't a cost you trade. It removes options.

Options two and three both pass. Option two passes for a third of the price. Compared with option one, it costs about €33,000 a year more, to keep a partner worth €1.2 million. That's the decision.

And why only the booking path? Because downtime doesn't cost the same everywhere. An hour without search or the marketing site costs far less. You buy resilience where failure is expensive. Karim was right about the risk. Omar was right not to add it everywhere.

07The standby nobody tested

Omar has a story for anyone who thinks resilience is something you buy. Two years ago, StayHub paid for a standby payments database. Then, one Sunday, the main database died.

The copy that was supposed to stay up to date had stopped copying six weeks earlier. Nobody noticed. The step-by-step guide for switching over, the runbook, pointed at servers that had been deleted.

Switching took three hours. Then the team had to rebuild six weeks of missing payments by hand. StayHub had paid the premium every month, and the policy didn't pay out.

The fix is part of the price. An alert when the copy falls behind. A failover drill every quarter: switch over on purpose, on a calm day. And a runbook that the drill exercises, so it can't go stale.

Resilience you haven't tested is only an invoice
What happened
  • · The copy had stopped copying six weeks earlier; nobody noticed
  • · The runbook pointed at deleted servers
  • · Nobody had ever switched over
  • · 3 hours down, then six weeks of payments rebuilt by hand
What a real standby includes
  • · An alert when the copy falls behind
  • · A failover drill every quarter, on a calm day
  • · A runbook the drill exercises, so it stays true
  • · The drills counted in the option's cost
The payments standby, two years ago: paid for every month, and it didn't pay out. The fixes are part of the price of any standby.

So when you price option two, the drills are in it. If you can't afford the drills, you can't really afford the standby. You've only bought the invoice.

08One-way and two-way doors

Not every decision deserves this much work. Ask one question: how hard is it to undo? A second region, your main database, where data must live: those are one-way doors. Expensive to walk back through.

A feature-flag tool or a log format is a two-way door. If it's wrong, you switch. Omar wanted three weeks of analysis for those two. Maya wanted a pick that afternoon. Here, Maya was right.

One-way and two-way doors
DecisionDoorEffort
A second regionOne-way: expensive to undoThe full method, a second opinion, an ADR
The main database, where data must liveOne-wayThe full method, an ADR
A feature-flag toolTwo-way: switch if wrongDecide this week; a short note of why
A log formatTwo-wayDecide this week
ADR-041 Warm standby region for the booking patharchitecture decision record
Context · options rejected · decision+€9,000 a month; recovery ~30 min; meets the partner's ≤ 1 h
Consequencesreplication to watch; quarterly drills; the rest stays in one region
Revisit whenAsia > 30% of bookings, or downtime > €40,000 an hour
Match the effort to the cost of undoing the decision. Spending three weeks on a two-way door is its own bad trade-off.

For one-way doors, write the decision down in an ADR, an architecture decision record: the context, the options you rejected, what you're giving up, and when to revisit.

For the standby, the trigger was written into the record: revisit if Asia passes 30% of bookings, or if an hour of downtime starts costing more than €40,000. In a year, someone will ask why. The record answers.

09Your job as lead

Claude Code can do the legwork of a decision. Ask it for a document, not code: compare the three options with our numbers, price each one all in, and mark every number it had to assume.

Watch for red flags. "Best practice" or "industry standard" with no numbers. A comparison of invoices only, with no downtime and no team time. A standby with no drill in the plan. Or infrastructure code written before the decision is made.

And ask three questions of every option. What does it give up? Which hard requirement does it fail? How will we test that it works?

Let's recap. Every option gives something up; say what it depends on, in numbers. Price options all in, like insurance: premium against expected loss. Hard requirements remove options. Test what you buy. And spend your effort on one-way doors. Next lesson: the hub that syncs rooms from ten thousand hotels wants €45,000 more a month. An engineer has a weekend prototype, and Karim asks why we pay anyone.

Check yourself

0/10 answered
  1. 1Two architectures both carry the traffic. One adds €29,000 a month, the other adds nothing. How do you choose?

  2. 2Which is a problem statement, rather than a solution in disguise?

  3. 3A region fails about once every two years for about eight hours, and an hour without bookings costs about €20,000. What's the expected loss per year?

  4. 4Why isn't option one (stay single-region, ~€80,000 a year all in) the decision, even though it's the cheapest?

  5. 5Option three costs about €240,000 a year more than option two and saves about €2,500 of expected downtime. What does that tell you?

  6. 6Why put the standby on the booking path only?

  7. 7StayHub paid for a standby payments database, but the switch took three hours. What was missing?

  8. 8Omar wants three weeks of analysis before choosing a feature-flag tool. What do you say?

  9. 9Claude Code's draft decision says: "Active-active for the whole platform: it's the industry standard for platforms our size." What do you ask for?

  10. 10What belongs in the ADR for the standby decision?

Free account

Save your progress — create a free account

Free. No card. Your finished lessons follow you to any device, and you can ask questions in the community.

Create my free account
Founding members

Every lesson is free while we build. Lock in €9/month for later.

The first 100 members keep the founding price for as long as they stay. Reserving is free: no card, nothing is charged.

See the founding offer

Questions from the community

All questions →