Polski

Article · Solution Architect – role and craft · Modular Monolith

Architecture decisions and ADRs: how to choose, weigh trade-offs and record the “why”

How a solution architect makes decisions that are hard to reverse: options analysis (build or buy, microservice or module, REST or Kafka), a weighted decision matrix with the calculation, a sensitivity test, an ADR template in the MADR format, two complete examples, adr-tools and the rules for communicating decisions.

By · · 16 min read

A year from now nobody will remember why you chose Kafka over REST, why orders didn't stay in the old shop platform, and why the event carries no customer address. A new developer will only see the consequences and ask: "who came up with this?". Without a record there are two options left – blindly stick to a decision whose purpose nobody knows, or change it and repeat the mistake it was protecting against. That is why architecture decisions are analysed, scored and recorded.

2011
Michael Nygard describes ADRs – the post "Documenting Architecture Decisions"
1–2
pages per ADR – one decision, not the whole project
4.05
score of the winning option – the example OrderFlow matrix below

Which decision is architectural

Grady Booch measures the significance of a decision by the cost of change. In practice, control questions help – if you answer "yes" to any of them, the decision deserves an analysis and an ADR:

  • Does it affect more than one team or system?
  • Does it concern data (model, ownership, location, retention) or a contract with someone outside?
  • Does it change whether we meet an NFR – response time, availability, security?
  • Does it bind us to a vendor or a licence for years?
  • Would reversing it take more than a sprint?

Choosing a logging library – no. Choosing whether the ERP learns about an order from an event or from a REST call – definitely yes.

Everything in software architecture is a trade-off.

— Mark Richards and Neal Ford, authors · Fundamentals of Software Architecture

The same book states the second law of software architecture: "why" is more important than "how". A diagram shows how the system is built. Only a decision record says why.

Options analysis: three classic dilemmas

The process is always similar: establish the decision drivers (usually straight from the NFR catalogue and the constraints), list 2–3 real options (often including "leave it as is"), assess them, verify uncertain assumptions with a PoC, decide and record. Three dilemmas come back in almost every project.

Build or buy

SignalRather buildRather buy
Type of domain (DDD)core domain – what the company beats competitors withgeneric domain – payroll, e-mail, identity, accounting
Volatilityrules change every weeka stable process, similar across the industry
Skillsthe team knows the domain and the stackno people, and the market has mature products
Five-year cost (TCO)team effort + maintenancelicences + integration + customisation + exit
Regulations and riskthe data must stay with usthe vendor meets the requirements and we have an exit strategy (NIS2: supply-chain security)

The worst option is often a third, unnamed one: buy and heavily customise. You pay for the licence, and then for every upgrade that breaks your modifications.

Microservice or module

The default answer is a module in an existing or new modular monolith. A separate service makes sense when that part must be deployed independently, has a different scaling or security profile, or belongs to a different team with a different rhythm. Every service means a pipeline, monitoring, on-call and contracts – a cost that has to pay off. Details are in the articles on the modular monolith and microservices.

REST or Kafka

The rule of thumb: ask synchronously, inform asynchronously. When you need the answer now (the payment authorisation for the order confirmation), you call synchronously – with a timeout and a fallback path. When you inform others of a fact (an order was confirmed), you publish an event – the sender then doesn't depend on the availability of the receivers, and a new consumer requires no changes on the sender's side. The price is eventual consistency, an outbox and idempotent consumers. More in the article on integrations and contracts.

The decision matrix: an example with the calculation

OrderFlow at Bazario, the decision: where to build order handling. Three options from the HLD article: A – extend the shop platform, B – a new OrderFlow service, C – a SaaS OMS platform. The criteria and weights were agreed with the PO, finance and legal before anyone scored the options. Scale: 1 – doesn't meet, 3 – meets with trade-offs, 5 – fully meets.

CriterionWeightA. Extend the shop platformB. New OrderFlow serviceC. SaaS OMS platform
Confirmation time < 2 s and scalability25%254
Compliance (GDPR), audit and no overselling20%443
Deadline – launch in Q215%425
Five-year cost (TCO)15%332
Flexibility of promotion rules15%253
Vendor dependency and exit strategy10%251
Weighted score100%2.854.053.20

The score is the sum of weight × rating. For option B: 0.25 × 5 + 0.20 × 4 + 0.15 × 2 + 0.15 × 3 + 0.15 × 5 + 0.10 × 5 = 1.25 + 0.80 + 0.30 + 0.45 + 0.75 + 0.50 = 4.05. The chart shows what each score is made of – you can see at once that B wins on performance and flexibility and loses on the deadline:

OrderFlow decision matrix: contribution of each criterion – Calculated from the table above (weight × rating). The ratings are examples – in a real project the team sets them based on PoCs, offers and conversations.
Confirmation time and scalabilityGDPR, audit, stockQ2 deadlineFive-year costPromotion flexibilityVendor exit
A. Shop platform0.5 weighted points0.8 weighted points0.6 weighted points0.45 weighted points0.3 weighted points0.2 weighted points
B. New OrderFlow service1.25 weighted points0.8 weighted points0.3 weighted points0.45 weighted points0.75 weighted points0.5 weighted points
C. SaaS OMS1 weighted points0.6 weighted points0.75 weighted points0.3 weighted points0.45 weighted points0.1 weighted points

Sensitivity test: what if the deadline matters more than we assumed? With weights of 30% for the deadline, 15% for performance and 10% for flexibility (the rest unchanged), the scores are A 3.15, B 3.60, C 3.40. B still wins, but its lead drops from 0.85 to 0.20 points. That is important information for the committee: if the Q2 date is immovable, the decision is fragile – which is why the team narrowed the MVP to own sales (third-party sellers in phase two) and recorded the deadline risk in the register.

The rest of this article is for members

Create a free account or sign in to read it all. Still ahead:

  • The trade-offs of the chosen option
  • ADR – recording one decision
  • Where to keep ADRs
  • How to communicate decisions
  • Related
  • Check yourself

Create a free account · Sign in