Make and Defend an Architecture Decision
Practical 18 - Make and Defend an Architecture Decision
Related: Chapter 18 · Lecture slides · Appendix A: Rosetta Stone · Appendix C: Deployment Checklist
Objective
Formulate, evaluate, benchmark, and document a major front-end architectural decision for an enterprise-scale public service platform. You will evaluate competing technical options against explicit organizational constraints and quality attributes, conduct a focused technical spike to resolve an empirical unknown, write a formal Architectural Decision Record (ADR), and define automated fitness functions and quantitative review triggers.
You will be evaluated on the rigor of your reasoning, the fidelity of your trade-off analysis, and your empirical evidence - not on whether you choose a trendy framework or adopt complex distributed patterns by default.
Scenario: The Unified Regional Civic Services Platform
The Kurdistan Regional Government is consolidating disparate municipal portals into a single, unified civic platform:
- Four Autonomous Squads: Team Transport (driving permits), Team Health (clinic bookings), Team Commerce (business registration), and Team Civil (ID renewals).
- Target Audience: 70% of traffic originates from mobile devices operating over high-latency 3G/4G cellular connections across Erbil, Sulaymaniyah, and Duhok.
- Regulatory Mandates: Public municipal notices must be crawlable by search engines (SEO); all forms must strictly meet WCAG 2.1 AA accessibility standards.
- Organizational Friction: Teams want deployment autonomy without being blocked by other squads, but citizens demand a consistent visual design, shared authentication sessions, and fast initial page loads.
Stage-by-Stage Implementation
Stage 1: Context, Forces, and Constraints Mapping
Begin by documenting the architectural forces without naming any libraries or frameworks. Create docs/architecture/context.md:
- Prioritized Quality Attribute Scenarios (QAS):
- Performance (P1): Under 4x CPU throttling and Fast 3G network conditions, the 75th percentile (p75) Largest Contentful Paint (LCP) must remain below 2.0 seconds for first-time visitors.
- Accessibility (P1): 100% of interactive controls must be navigable via keyboard and expose computed accessible names.
- Autonomy (P2): Squads must be able to deploy updates to their domain routes without forcing a full redeploy of unrelated domain services.
- Operational Simplicity (P3): The deployment infrastructure must be maintainable by a small platform team without requiring dedicated Kubernetes cluster operators.
- Non-Negotiable Constraints:
- Budget constraints prohibit expensive multi-region proprietary edge compute licensing.
- Unified authentication (OAuth2 / PKCE) must be shared seamlessly across all domain routes.
Stage 2: Formulating Three Viable Candidate Architectures
Generate three genuinely viable, competing architectural options. Avoid creating straw-man options designed solely to be discarded:
| Candidate Architecture | Rendering & Routing Strategy | Code Organization & Deployment Model | Primary Trade-Off |
|---|---|---|---|
| Candidate A: Micro-Frontends | Client-Side Module Federation with host shell container. | Multi-repo; each squad deploys independent bundles to S3/CDN. | Maximum squad autonomy; high bundle bloat (duplicate framework runtimes) and high initial latency. |
| Candidate B: Client-Side SPA (CSR) | Pure client-rendered single-page app with service worker offline cache. | Single monorepo; static S3 hosting behind global CDN. | Zero server compute cost; fails public SEO requirements and suffers slow LCP on 3G. |
| Candidate C: Modular Monolith with Edge SSR | Edge-rendered hybrid (Server Components / SSR with islands of interactivity). | pnpm monorepo; shared design system; single deployable artifact. | Sub-second LCP and strong SEO; requires monorepo build governance and coordinated releases. |
Stage 3: The Investigative Technical Spike
Before committing to an architectural direction, conduct a focused empirical spike to resolve the highest-risk unknown: What is the initial payload weight and mobile FCP/LCP penalty of client-side Module Federation versus a tree-shaken Modular Monolith?
- Create a minimal spike workspace (
spikes/federation-vs-monolith/). - Build a shell container importing two remote federated components (Transport Card and Health Card).
- Build an equivalent modular monolith bundle using standard dynamic imports (
import()). - Run Lighthouse audits using Chrome DevTools with simulated Fast 3G and 4x CPU throttling.
- Record your findings in
docs/architecture/spike-01-results.md:
Stage 4: Formal Architectural Decision Record (ADR)
Using the canonical template from Chapter 18, draft ADR-018: Adoption of Modular Monolith with Edge SSR for Civic Services Platform:
Stage 5: Reversal Plan & Review Trigger Conditions
An architectural decision is not an eternal monument; it is a hypothesis validated by evidence. Define the exact conditions under which ADR-018 will be formally reopened:
Verification & Self-Assessment
Audit your architectural decision against the evaluation criteria:
| Verification Item | Evaluation Criteria | Pass / Fail |
|---|---|---|
| Requirements-Driven | Decision is anchored in mobile 3G constraints and WCAG AA mandates rather than framework trends. | Pass |
| Viable Alternatives | Considered three distinct options, complete with genuine technical trade-offs. | Pass |
| Empirical Evidence | Conducted Spike 01; measured bundle size and LCP data rather than quoting blog posts. | Pass |
| Automated Fitness Functions | Defined actionable CI rules (ESLint boundaries, bundle size budgets) to protect architectural properties. | Pass |
| Quantitative Reversal Plan | Documented explicit numerical triggers (team size >12 squads, CI >35 min) for revisiting the decision. | Pass |
| Appendix C Alignment | Verified that the architecture satisfies the Section 6 (Architecture Sign-Off) checklist in Appendix C. | Pass |
Grading Rubric
| Criterion | Points | Evaluation Requirement |
|---|---|---|
| Problem & Constraint Articulation | 20% | Quality attributes are formulated as measurable scenarios; organizational and network constraints are clearly defined. |
| Trade-Off Analysis of Alternatives | 20% | Evaluates three viable options; clearly explains why rejected options failed constraints. |
| Empirical Spike Rigor | 20% | Technical spike measures concrete performance metrics (bundle sizes, LCP, CPU time) under throttled conditions. |
| ADR Completeness & Fitness Functions | 25% | ADR follows standard format; consequences are balanced; automated CI guardrails enforce architectural boundaries. |
| Reversibility & Evolution Strategy | 15% | Reversal triggers are quantified; includes a credible migration plan if assumptions change. |