Microservice Decomposition and Architectural Risk Matrix
Assess monolith boundaries and shared dependencies to build an operational decoupling risk matrix.
Use this template when planning the operational extraction of domain services from a monolithic codebase. It generates a multi-dimensional risk matrix balancing data consistency, transaction boundaries, and team topology.
Role: Principal Enterprise Systems Architect and Technical Operations Lead
Context
- Existing Monolith Dependency Map: {{monolith_dependency_graph}}
- Core Transaction and Domain Boundaries: {{critical_transaction_boundaries}}
- Current State Persistence and Consistency Models: {{data_consistency_models}}
- Engineering Squad Ownership and Topology: {{team_topologies_ownership}}
- Latency and Throughput Thresholds: {{latency_sla_thresholds}}
- Permissible Migration Risk Budget: {{migration_risk_budget}}
Task
Develop a Microservice Decomposition and Architectural Risk Matrix that systematically evaluates extraction feasibility, runtime blast radius, and migration trade-offs for isolating legacy monolithic modules into discrete operational services.
Method
- Analyze {{monolith_dependency_graph}} to isolate coupled runtime dependencies, shared database tables, and cyclic references.
- Cross-reference domain components against {{critical_transaction_boundaries}} to evaluate the impact of replacing ACID transactions with eventual consistency.
- Assess {{data_consistency_models}} to identify required dual-write, outbox pattern, or CDC (Change Data Capture) requirements.
- Map extraction candidates against {{team_topologies_ownership}} to align architectural boundaries with Conway's Law.
- Project network overhead and serialization latency to ensure adherence to {{latency_sla_thresholds}}.
- Evaluate operational complexity (observability, distributed tracing, network failure modes) within {{migration_risk_budget}}.
- Construct a prioritized decoupling matrix ranking service extraction targets by business value and operational difficulty.
Constraints
- MUST NOT recommend microservice extraction for domains lacking clear transactional autonomy or single-team ownership.
- Eventual consistency mechanisms MUST explicitly specify compensation and reconciliation patterns (e.g., Saga, Outbox).
- Latency projections MUST include realistic cross-network transport and TLS negotiation overheads.
- Every extraction candidate MUST detail a zero-downtime database migration strategy.
Output format
- Section 1: Architectural Domain Landscape (max 150 words)
- Section 2: Service Decomposition Decision Matrix (Markdown table with columns: Candidate Domain, Coupling Index, Data Consistency Strategy, Cross-Network Latency Delta, Blast Radius, Extraction Complexity, Recommended Pattern)
- Section 3: Operational Failure Modes & Distributed Fallbacks (Detailed table with columns: Extracted Service, Network Partition Impact, Fallback/Degradation Mode, Data Sync Recovery Path)
Self-review
- Does the matrix prevent distributed monolith anti-patterns by strictly checking boundary coupling?
- Are data migration strategies realistic and zero-downtime compatible?
- Does the extraction sequence match team ownership capacity?
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.