A staff-level architecture decision across three contrasting systems, matching layered or vertical slice, modular monolith with DDD, and selective services with event-driven integration to domain complexity, scale, team and compliance needs, recorded in ADRs.
I pick per system, from its drivers, not one house style:
Each choice goes in an ADR with options, consequences and revisit triggers. The trade-off: consistency across systems vs fit for each.
"I'd refuse to pick one architecture for all three, because their drivers are completely different. I start each with the same questions: what quality attributes matter most, how complex is the domain, what scale and growth do we expect, how many teams will work on it, and what compliance applies.
The admin app has simple rules and maybe a hundred internal users. Speed of delivery and low maintenance dominate, so I'd build a single ASP.NET Core app with vertical slices, EF Core used directly in handlers, Razor Pages or Blazor for the UI, and Entra ID for sign-in. No repositories, no DDD layers — they'd protect nothing. The insurance policy system is the opposite: rules about cover, endorsements, renewals and rating change for years and must be right. That's where DDD pays off: I'd run event storming to find bounded contexts — Policy, Rating, Underwriting, Billing — and build a modular monolith with a module per context, each with a rich aggregate model and a Clean or hexagonal core, talking through contracts and events. One deployable keeps operations simple for [two or three] teams, and the seams let us extract a module if it ever needs it. The payments platform is where distribution earns its keep: very high throughput, near-zero tolerance for double charges, and PCI DSS scope we want as small as possible. I'd split a small number of services along those lines — a card vault and tokenisation service isolated for PCI, a payment orchestration service, and ledger and reconciliation — with idempotency keys on every API, outbox and inbox for messaging, and serious tracing and SLOs. For example, at [company] I [proposed a similar split in an ADR, ran a spike that measured X], and [we disagreed on Y, I committed to the team's choice, and we revisited after Z].
The mistake I see is a house architecture applied everywhere: the admin app gets microservices, or the payments platform gets a CRUD template. I write an ADR per system with the options, the decision, the consequences and the triggers that would make us revisit it. Architecture is a fit to drivers, and different systems have different drivers."
| Driver | Admin app | Insurance policy admin | Payments platform |
|---|---|---|---|
| Domain complexity | Low | Very high | Medium (but unforgiving) |
| Scale | ~100 users | Thousands of users, batch renewals | Thousands of TPS at peak |
| Top quality attributes | Delivery speed, low cost | Modifiability, correctness, auditability | Availability, security, consistency, latency |
| Teams | 1 small team | 2–4 teams | 3+ teams plus a platform team |
| Compliance | Privacy Act/APPs for staff data | APRA CPS 234, Privacy Act, NDB | PCI DSS, APRA CPS 234, AUSTRAC obligations where applicable |
| Admin app | Insurance policy admin | Payments platform | |
|---|---|---|---|
| Style | Vertical slices (or simple layered) | Modular monolith, DDD, Clean core per module | Small set of services, event-driven |
| Data | One database, EF Core directly | One database, schema per module | Database per service; ledger append-only |
| Integration | None or simple APIs | Contracts + in-process events, outbox | Service Bus/Kafka, outbox + inbox, idempotency keys |
| Hosting | One App Service | App Service or Container Apps, scaled out | AKS or Container Apps, multi-zone in Australia East, DR in Southeast |
| Testing | Integration tests with Testcontainers | Heavy domain unit tests + architecture tests | Contract tests, chaos and load tests, reconciliation checks |
At one insurer, using three different architectures was contentious at first. Twelve months on, the admin app had shipped 40 releases with a two-person team, the policy system's modular monolith had absorbed two product launches without structural change, and the payments services held 99.99% availability across peak renewal periods while keeping PCI scope to two services instead of the whole estate.
Checks that the candidate can derive different architectures from different drivers, justify them with trade-offs and compliance, and lead the decision through ADRs and evolution triggers.
Green flags
Red flags
Business goals --> Quality attributes (ranked) --> Constraints (team, budget, compliance, deadline)
| |
v v
Domain analysis (event storming, bounded contexts) Options (2-3 candidate architectures)
\__________________________ ____________________________/
v
Evaluate against drivers (decision matrix, spikes)
v
ADR: decision, consequences, revisit triggers
v
Fitness functions in CI and production
The Architecture Tradeoff Analysis Method (ATAM) formalises this; in practice a ranked list of quality attributes plus a couple of time-boxed spikes covers most decisions.
[Browser] -> [ASP.NET Core: Razor Pages / Minimal APIs, vertical slices] -> [Azure SQL]
Entra ID sign-in, EF Core directly
No repositories, no mediator required, no separate API tier. Risk: scope creep turning it into a domain system — the revisit trigger.
+-------------------------------------------------------------+
| Policy Admin (one deployable) |
| +----------+ +----------+ +-------------+ +-----------+ |
| | Policy | | Rating | | Underwriting| | Billing | |
| | module | | module | | module | | module | |
| +----+-----+ +----+-----+ +------+------+ +-----+-----+ |
| | contracts + events (outbox) | | |
+------+-------------+---------------+---------------+-------+
[policy] [rating] [underwriting] [billing] schemas
Rich aggregates (Policy with Endorse, Renew, Cancel), value objects (Premium, CoverPeriod), domain events (PolicyRenewed). Temporal tables or event history for auditability.
[Merchants] -> [API Management] -> [Payment API / Orchestrator] --(events)--> [Ledger]
| [Reconciliation]
v
[Card Vault / Tokenisation] (PCI DSS zone, isolated network)
Key mechanisms: idempotency keys on create-payment, outbox for events, inbox for consumers, an append-only double-entry ledger, reconciliation against acquirer files, and SLOs on authorisation latency (for example p99 < 300 ms).
A lightweight ADR (Michael Nygard's format):
Prefer reversible choices early. A modular monolith can become services; a premature service split is expensive to merge. Fitness functions (architecture tests, latency budgets, deployment frequency per team) tell you when the trigger is reached.
Solution layouts for the three systems, plus an ADR template.
# 1. Admin app: one project, vertical slices
AdminPortal/
Features/
Users/ListUsers.cs // query + endpoint
Users/DeactivateUser.cs // command + endpoint
Products/EditProduct.cs
Data/AdminDbContext.cs
Program.cs
# 2. Policy administration: modular monolith
src/
Host/Program.cs // AddPolicyModule(), AddRatingModule(), ...
Modules/
Policy/Policy.Contracts/ // public DTOs, integration events
Policy/Policy.Core/ // domain + application (internal)
Policy/Policy.Infrastructure/
Rating/...
Billing/...
tests/
Architecture.Tests/ // module boundary rules
Policy.Core.Tests/ // aggregate invariants
# 3. Payments platform: separate repos or deployables per service
services/
payment-api/ // orchestration, idempotency
card-vault/ // PCI DSS zone, tokenisation
ledger/ // append-only double-entry
reconciliation/ // batch matching against acquirer files
platform/
bicep/ // network isolation, private endpoints, Key Vault
// A rich aggregate from the policy system: where DDD earns its keep
namespace Policy.Core.Policies;
public sealed class InsurancePolicy
{
private readonly List<Endorsement> _endorsements = [];
private InsurancePolicy() { }
public Guid Id { get; private set; } = Guid.NewGuid();
public DateOnly CoverStart { get; private set; }
public DateOnly CoverEnd { get; private set; }
public PolicyStatus Status { get; private set; } = PolicyStatus.Active;
public IReadOnlyList<Endorsement> Endorsements => _endorsements;
public static InsurancePolicy Issue(DateOnly start, int months) =>
new() { CoverStart = start, CoverEnd = start.AddMonths(months) };
public void Endorse(string change, DateOnly effective)
{
// Invariant: an endorsement must take effect within the current cover period of an active policy.
if (Status != PolicyStatus.Active)
throw new InvalidOperationException("Only active policies can be endorsed.");
if (effective < CoverStart || effective > CoverEnd)
throw new ArgumentOutOfRangeException(nameof(effective), "Endorsement must fall within cover.");
_endorsements.Add(new Endorsement(change, effective));
}
}
public sealed record Endorsement(string Change, DateOnly Effective);
public enum PolicyStatus { Active, Lapsed, Cancelled }
# ADR-007: Policy administration as a modular monolith
Status: Accepted (2026-11-20)
Context: complex, long-lived rules; 3 teams; APRA CPS 234; data must stay in Australia East/Southeast.
Options: (a) microservices per context, (b) modular monolith, (c) layered monolith.
Decision: (b), one module per bounded context, schema per module, events via outbox.
Consequences: + simple ops, strong consistency inside modules, cheap refactoring;
- shared release train, one scaling unit.
Revisit when: a module needs independent scaling, or teams block each other's releases > 3 times a quarter.
Staff-level architecture is mostly matching structure to drivers and making the reasoning visible. The three systems here deliberately get three different answers, and I'd defend that diversity: consistency of practices (CI/CD, observability, security baselines, ADRs) matters more than consistency of architecture style. I also favour reversible choices: modular monolith first wherever the boundaries are still being learned, services only where scale or compliance justify them on day one.
The drivers aren't mine to invent. I run a short workshop per system with product (time to market, roadmap), risk and compliance (APRA CPS 234, PCI DSS, Privacy Act obligations), security, operations/SRE (on-call capacity, SLOs) and the delivery teams who will live with it, and we agree a ranked list of quality attributes before anyone proposes a style. That turns later debates into "which option best serves the drivers we agreed?" rather than preference. Where people still disagree, a time-boxed spike with measurements settles it, and once the decision is made I commit to it and set revisit triggers so dissenters know when it will be looked at again.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Vertical slices / layered | Simple rules, small team, fast delivery | Low | Complex, shared invariants |
| Modular monolith + DDD | Complex domain, 1–5 teams, evolving boundaries | Boundary discipline, modelling skill | Trivial CRUD or radically different scaling needs |
| Selective services, event-driven | High scale, strict compliance zones, many teams | Ops, consistency, tracing, platform team | Unclear boundaries, small org |
I'd measure whether each choice was right with DORA metrics per system, incident and defect rates, cost per transaction, and how often the ADR's revisit triggers fire.
I choose patterns from the forces, not from a template: domain complexity and invariants, consistency needs, integrations, scale and the team.
Every service gets a cheap baseline: DbContext as the unit of work, DTOs at boundaries, validation, typed HttpClients with resilience, an outbox for integration events, and observability.
DbContext in handlers and projections for reads. No repositories, CQRS levels, mediator or domain services.Each extra pattern needs a named trigger. I record decisions as ADRs with reversal conditions and enforce them with architecture tests. The trade-off is fitting the design to today's problem against preparing for change that may never come.
A modular monolith is one deployable split into modules aligned to business capabilities — Orders, Billing, Catalogue — each with hard boundaries.
DbContext, no cross-module joins or foreign keys.internal.internal types, architecture tests, even per-schema database permissions.You get microservice-style boundaries with monolith-style operations: one pipeline, in-process calls, easy refactoring. The trade-off: one runtime, one release and one scaling unit, and it only works if the boundaries are enforced — otherwise it decays into a big ball of mud.
Evolutionary architecture (Ford, Parsons and Kua) is architecture designed to support guided, incremental change, rather than a fixed upfront design. The key tool is fitness functions: automated checks that protect the characteristics you care about, such as dependency rules (architecture tests), latency budgets, or startup time, run in CI or production. Around that, I keep boundaries modular (often a modular monolith first), make decisions reversible where possible and defer irreversible ones to the last responsible moment, record decisions in ADRs, and rely on continuous delivery, feature flags and observability so each change is small and safe.
How to tell it (STAR)
**S:** At [insurer], a microservices-for-everything standard meant a [2-person] admin tool ran [6] services with a [9-day] lead time, while the complex policy platform was built as CRUD. **T:** As [principal engineer], I wanted architecture to follow each system's drivers. **A:** I mapped all three systems against ranked quality attributes, wrote three ADRs, and ran a [two-week] spike collapsing the admin tool into one app. Some architects disagreed about the policy platform; we agreed a revisit trigger and I committed to the outcome. **R:** The admin tool's lead time dropped to [1 day], its hosting cost fell [~70%], and the standard was replaced by a decision guide used for the next [5] systems.
Last updated 23 Nov 2026.