Skip to content
Tech Atlas, home
Search
Esc
  • All roadmapsBrowse every learning path
  • ExploreFind a technology area
  • ProjectsGuided projects and builds
  • My AtlasYour learning dashboard
Lesson 2 of 6 · Worked example · 25 min · revision 1

Options analysis with weighted drivers

Compare four options for surviving a region outage, including doing nothing, against weighted drivers with a small Python script: apply a knock-out first, read the totals, and run a sensitivity check that shows one weight can flip the choice.

Contentsand lesson path

What you will learn

  • Compare at least three options, including doing nothing, against weighted drivers and make the trade-off explicit.

01. Why it matters

Architecture choices are rarely between a good option and a bad one. They are between options that are each good at different things, and the hard part is making the trade-off visible, so that the people who will live with it can see what was given up and why. A weighted options analysis does that. It lists the drivers, the goals and quality attributes the decision must serve, gives each one a weight, scores every option against every driver, and adds up the results.

The numbers are not the decision. Weights and scores are judgements, and a total that looks precise can hide how fragile it is. This lesson works through one decision, then tests whether one changed weight would change the result. Good drivers are measurable; if quality attribute scenarios are new to you, read the scenarios lesson first.

02. The problem: surviving the loss of a region

An online grocery runs its order platform in one cloud region, with a PostgreSQL primary, a replica in the same region and nightly backups copied to a second region. Last spring the region had a four-hour outage, and no orders could be placed for the whole time. Leadership asks the architecture group what to do.

Two terms frame the drivers. The recovery time objective (RTO) is how long the service may be down after a disaster. The recovery point objective (RPO) is how much recent data the business accepts losing, measured as time. The company's continuity policy already sets one hard limit: no more than 15 minutes of orders may be lost.

The group agrees five drivers, with weights from 1 (nice to have) to 5 (critical):

  • rto (5): how quickly orders can be taken again after a region loss;
  • rpo (4): how little data is lost, within the 15-minute limit;
  • cost (3): the running cost of the extra infrastructure;
  • ops (3): the operational load on an SRE team of five;
  • delivery (3): how soon the option can be in place.

It lists four options, starting with doing nothing, the baseline every change has to beat:

  • A, do nothing: keep the nightly backups and the restore runbook;
  • B, backup and restore: archive the database's write-ahead log continuously to the second region, so the database can be restored to a recent point in time, and keep scripts that rebuild the application stack there;
  • C, warm standby: run a streaming replica and a scaled-down copy of the application in the second region, and scale it up on failover;
  • D, active-active: both regions take orders all the time.

03. Step 1: Knock-outs first, then scores with reasons

Before scoring, apply the knock-out criteria: hard requirements that an option either meets or does not. A knock-out is not the same as a heavy weight. A weight trades one driver against the others, while a knock-out says that no benefit elsewhere can make up for missing it. Here the 15-minute limit on lost orders is a knock-out, and doing nothing fails it, because a nightly backup can lose up to a day of orders. The worst-case losses in the script are assumptions too: 5 minutes for B assumes the database closes a log segment at least every 5 minutes (archive_timeout in PostgreSQL), and 1 minute for C and D assumes replication lag stays under a minute, which monitoring must confirm. Keep option A in the table anyway: it shows what the change buys compared with today.

Each option then gets a score from 1 to 5 for each driver, where 5 is always better. That rule matters most for cost: the cheapest option gets the highest cost score. Mixing directions, or mixing raw figures such as euros or milliseconds with 1–5 scores, quietly rewards the wrong option.

Scores come from evidence where there is some, and from the group's judgement where there is not. Write the reason next to every score, because the reasons are what a reviewer will question. For example, B gets rto 2 because rebuilding the stack and restoring the database took about three hours in last year's restore drill. C gets rto 4 because promoting a replica and scaling up a running stack should take well under an hour, which a failover test still has to prove. These are this team's estimates, not general figures: restore times depend on data size, tooling and practice.

04. Step 2: Compute the totals and a sensitivity check

The script holds the agreed weights and scores, applies the knock-out, ranks the options, and then runs a sensitivity analysis: it changes one weight at a time across the whole 1–5 range, keeps the others fixed, and reports every value that changes the winner. It needs only Python 3.12 and its standard library.

Python · matrix.py
"""Weighted options analysis: how should the order platform survive a region loss?"""

WEIGHTS = {"rto": 5, "rpo": 4, "cost": 3, "ops": 3, "delivery": 3}

# Scores 1-5 agreed in the review. Higher is better for EVERY driver,
# so the cheapest option gets the highest cost score.
OPTIONS = {
    "A do nothing": {"rto": 1, "rpo": 1, "cost": 5, "ops": 5, "delivery": 5},
    "B backup and restore": {"rto": 2, "rpo": 4, "cost": 4, "ops": 4, "delivery": 4},
    "C warm standby": {"rto": 4, "rpo": 4, "cost": 3, "ops": 3, "delivery": 3},
    "D active-active": {"rto": 5, "rpo": 4, "cost": 1, "ops": 1, "delivery": 1},
}

# Knock-out: the continuity policy allows at most 15 minutes of lost orders.
MAX_LOSS_MIN = 15
WORST_LOSS_MIN = {"A do nothing": 1440, "B backup and restore": 5,
                  "C warm standby": 1, "D active-active": 1}


def total(name: str, weights: dict[str, int]) -> int:
    return sum(weights[d] * OPTIONS[name][d] for d in weights)


def winner(weights: dict[str, int], names: list[str]) -> str:
    ranked = sorted(names, key=lambda n: total(n, weights), reverse=True)
    if total(ranked[0], weights) == total(ranked[1], weights):
        return "tie"
    return ranked[0][0]  # the option letter


eligible = [n for n in OPTIONS if WORST_LOSS_MIN[n] <= MAX_LOSS_MIN]
best = 5 * sum(WEIGHTS.values())

print(f"Knock-out: worst-case data loss <= {MAX_LOSS_MIN} min")
for name in OPTIONS:
    verdict = "pass" if name in eligible else "EXCLUDED"
    print(f"  {name:<22}{WORST_LOSS_MIN[name]:>5} min  {verdict}")

print(f"\nWeighted totals (best possible {best})")
for name in sorted(OPTIONS, key=lambda n: total(n, WEIGHTS), reverse=True):
    score = total(name, WEIGHTS)
    note = f"{score / best:.1%}" if name in eligible else "excluded"
    print(f"  {name:<22}{score:>4}  {note}")

base = winner(WEIGHTS, eligible)
print(f"\nSensitivity: change one weight (1-5), keep the others; base winner {base}")
for driver in WEIGHTS:
    flips = []
    for w in range(1, 6):
        result = winner({**WEIGHTS, driver: w}, eligible)
        if result != base:
            flips.append(f"{w}->{result}")
    print(f"  {driver:<9}base {WEIGHTS[driver]}  " + (", ".join(flips) or "no change"))
Terminal
python3 matrix.py
Expected output
Knock-out: worst-case data loss <= 15 min
  A do nothing           1440 min  EXCLUDED
  B backup and restore      5 min  pass
  C warm standby            1 min  pass
  D active-active           1 min  pass

Weighted totals (best possible 90)
  C warm standby          63  70.0%
  B backup and restore    62  68.9%
  A do nothing            54  excluded
  D active-active         50  55.6%

Sensitivity: change one weight (1-5), keep the others; base winner C
  rto      base 5  1->B, 2->B, 3->B, 4->B
  rpo      base 4  no change
  cost     base 3  4->tie, 5->B
  ops      base 3  4->tie, 5->B
  delivery base 3  4->tie, 5->B

Read the output in three parts.

The knock-out removes A. Notice that A still scores 54, more than active-active at 50: doing nothing is cheap, simple and already in place. That is why it belongs in every comparison, and why a hard requirement is checked before the totals, not folded into them.

The totals put warm standby (C) first with 63 of 90, one point ahead of backup and restore (B) with 62. As shares of the best possible score that is 70.0% against 68.9%, a gap far smaller than the uncertainty in the scores themselves.

The sensitivity lines show how fragile that lead is. Lowering the rto weight from 5 to 4 makes B the winner. Raising cost, ops or delivery from 3 to 4 produces a tie, and raising any of them to 5 makes B win. The rpo weight changes nothing, because B, C and D all score 4 on it. In plain words: the choice between B and C depends almost entirely on how much the business values the difference between about three hours and well under an hour of downtime.

05. Step 3: Decide, and record the trade-off

The matrix has done its job. It narrowed four options to two and showed which judgement decides between them, but it cannot make that judgement. The group takes the question back to the people who own the risk, with the numbers attached: warm standby costs more each month, according to the team's own cost estimate, and saves about two hours of downtime per regional outage. The head of operations confirms that taking orders is the company's most important capability, and that a three-hour outage at peak would cost more than a year of the extra running cost. The rto weight of 5 stands, and C is chosen.

The decision record then states what was chosen and what it costs, not only the winner:

  • the options, including doing nothing and the knock-out that excluded it;
  • the drivers and weights, and who agreed them;
  • the totals and the sensitivity result: the choice flips to B if the rto weight drops to 4;
  • the downsides accepted: a higher running cost, and a second region to patch and test;
  • a confirmation step: a failover test every quarter that measures the real recovery time;
  • a revisit trigger: two failover tests in a row that take over an hour, or a change in the business that makes three hours of downtime acceptable.

Recording the sensitivity tells a future reader at once that a change in business priorities means this decision should be looked at again.

06. Common mistakes

07. Check your understanding

Practice check · 3 questions

Weighted analysis check

Three matrices with a fault in how they were built. Find the fault.

Q1. In a matrix for choosing a search service, the option with the highest monthly bill comes out on top. The cost column holds each option's monthly bill in euros (900, 2,400 and 6,100), while every other column holds 1–5 scores. What is the most likely fault?
Q2. A payroll platform must keep employee data inside the EU by law. In the matrix, a service hosted only in the US scores highest overall, because it wins on features and price. What should the analysis do with it?
Q3. A comparison of three time-series databases has the drivers ingest throughput, peak writes per second and scalability, each with weight 4, plus ops effort and team skills with weight 3. Option K wins mainly on the first three. What should a reviewer question first?
Practice only: not graded, not saved, not evidence.

08. Apply it

Pick a decision your team faces now, or one of the candidates from lesson 1. Copy matrix.py, replace the drivers, weights, options and scores, and add at least one knock-out. Agree the weights with at least one other person before anyone scores, and write a one-line reason for every score.

Run the script and read the sensitivity lines. If one step on one weight changes the winner, write down the question that weight stands for and who should answer it. Keep the script and its output: the ADR you write after lesson 3 can quote both, and the practice project for this skill asks for this kind of comparison behind each of its four records.

09. Review prompt

Without looking back: explain why doing nothing belongs in every comparison, even when it is likely to fail a requirement. Describe the difference between a knock-out and a high weight, and why every driver must use one scale where higher is better. Then explain what a sensitivity check does, and what you should do when it shows that a single weight decides the result.

References

Your progress

Reading state

Sign in to save that you finished reading this lesson.

Sign in to mark reading complete

Prove this skill

8 questions · about 6 minutes · scored automatically. Marking a lesson as read never demonstrates a skill.
Take the skill check