Lab 01 — Architecture Decision Toolkit

Phase: 15 — Principal Architecture & Strategy | Difficulty: ⭐⭐⭐☆☆ | Time: 4–5 hours

A principal's output is decisions, defended with numbers and made durable in writing. This lab builds the instruments: a weighted decision matrix with an explainable deciding factor (Build-vs-Buy, tool selection), TCO economics, a safe-migration gate checker (the Round-5 Hive→lakehouse discipline), an RPO/RTO check, and an ADR renderer.

What you build

  • weighted_score / rank_options / recommend — score N architectures on weighted factors and return the winner and the deciding factor (the ADR sentence)
  • tco — total cost of ownership over a horizon (the Build-vs-Buy crossover)
  • migration_gate_check — verify a migration has the safety gates in order (dual_write → validate → cutover → decommission, decommission last) — never cut over before validating parity
  • dr_meets_targets — RPO/RTO adequacy for multi-region DR
  • render_adr — produce an Architecture Decision Record

Key concepts

ConceptWhat to understand
Decision matrix"best" is meaningless without weights; the deciding factor is the ADR
TCOBuild = high upfront/low monthly; Buy = reverse; find the crossover
Safe migrationdual-write → validate parity → cutover → decommission (rollback always)
RPO/RTOthe two numbers that define DR and its cost
ADRdecisions become durable, reviewable, reversible-on-purpose

Run

pip install -r requirements.txt
pytest test_lab.py -v
LAB_MODULE=solution pytest test_lab.py -v

Success criteria

  • All 15 tests pass — test_weights_change_winner and test_cutover_before_validate_is_unsafe are the ones that certify the judgment model.
  • You can take any "build vs buy" or "tool X vs Y" decision and produce a scored ADR.
  • You can lay out a Hive/Tez/Flume → Kafka/Flink/Iceberg migration with correct, safe gates.

Extensions

  • Add a sensitivity analysis: how much would a weight have to change to flip the winner? (the robustness of the decision).
  • Add risk-adjusted TCO (probability-weighted cost scenarios) and a payback-period calculator.
  • Generate a full migration runbook from a gate plan (per-phase entry/exit criteria + rollback steps) — the artifact you present in a design review.