- Home
- Skills
- APIs & Backend
- Monolith Architecture and Scaling Architect
Monolith Architecture and Scaling Architect
Architects maintainable monolithic systems: layer boundaries, shared-database scaling, and deployment pipelines.
$9
Works with the AI tools you already use
Monolith Architecture and Scaling Architect
Example session with this skill installed
Architect unified Monolith architecture, layer boundaries, and horizontal scaling for our Auto Insurance Policy & Quoting Platform.
- Subject: auto-insurance-policy-monolith v3.0 (run-id: auto-mono-arch-001) serving 3.8 million policyholders with 24 developers across 3 squads.
- Deciders: Chief Architect (David O'Reilly) and Head of Insurance Systems (Elena Rostova).
- Scope: Peak 4,200 quote calculations/sec; p99 quoting latency budget <= 45 ms; single primary AWS Aurora PostgreSQL with 2 read replicas.
- Tension: Management proposed breaking into 14 microservices; David O'Reilly and Elena Rostova resist microservices, citing the small 24-developer team and incident INC-4932 where premature fragmentation caused 18-minute pipeline freezes and $1.4M in cloud overhead. They mandate a Unified Monolith Architecture: clean package layer boundaries, in-process thread pools, shared-database connection pool scaling, blue-green pipelines, and sub-45ms quoting execution.
Write the monolith architecture overview under docs/.
- Read your context and instructions
- Compiled the monolith architecture
Wrote docs/architecture/monolith-architect/00-overview/monolith-architect-overview.md and docs/architecture/monolith-architect/verification/fitness-self-check.md. Complete Monolith architecture specification establishing clean layer boundaries, horizontal compute scaling, shared Aurora database connection pooling, and sub-45ms execution.
skill: monolith-architect
Monolith Architecture: National Auto Insurance Platform [MONOARCH-INS-001]
Summary
This specification establishes the unified Monolith architecture, structural layer boundaries, horizontal compute scaling model, and shared database governance for auto-insurance-policy-monolith v3.0 under run ID auto-mono-arch-001. It governs policy quoting, policy lifecycle administration, billing collections, and first-notice-of-loss claims across 3.8 million active policyholders with 24 developers organized into 3 product squads. It decisively resolves the operational thrashing demonstrated in incident INC-4932 (where attempting to manage 14 experimental microservices with only 24 developers caused 18-minute deployment pipeline freezes and $1.4M in wasted cloud infrastructure costs). The architecture establishes a
Unified Monolithic Application Core deployed as a single optimized JVM artifact across horizontal stateless AWS ECS compute tasks, leverages a single
AWS Aurora PostgreSQL cluster with read-replicas, maintains strict
in-process package layer boundaries, and achieves a quoting computation latency of
p99 <= 45 ms.
Detailed Description
For engineering organizations with fewer than 30 developers, decomposing a line-of-business platform into dozens of microservices creates crippling operational friction. Developers spend more time managing Dockerfiles, Helm charts, service meshes, and cross-repo dependencies than shipping business value. A well-architected Monolith provides exceptional development velocity, effortless local debugging, zero-network in-process performance, and atomic ACID transaction simplicity. By decoupling compute from storage, the monolith scales horizontally across dozens of stateless application containers behind an Application Load Balancer while reading and writing to an Aurora PostgreSQL database cluster.
Public Consumer Quoting Traffic (4,200 req/sec)
│
▼
[ AWS Application Load Balancer (ALB) ]
└── Round-Robin Ingress across Stateless ECS Tasks
│
┌─────────────────┼─────────────────┐ (Horizontal Compute Scaling)
▼ ▼ ▼
[ Monolith Task 01 ] [ Monolith Task 08 ] [ Monolith Task 16 ]
├── 1. Web Layer: Spring Boot REST Controllers
├── 2. Core Service Layer: In-Process Rating Engine (< 12 ms)
├── 3. In-Memory Job Queue: High-Throughput Thread Pools
└── 4. HikariCP Connection Pool (Max 25 Connections / Task)
│
┌────────────────┴────────────────┐
▼ (Mutating Writes) ▼ (Analytical Reads: 85% Traffic)
[ Aurora PostgreSQL Primary ] [ Aurora Read Replica Pool (2 Nodes) ]
(3NF Relational Schema) (Policy Search & Quoting Reports)
Criteria and weights
| Criterion | Why it matters here | Weight | Source of the weight |
|---|---|---|---|
| Engineering Team Delivery Velocity | 24 developers must focus on insurance business features without microservice SRE drag (INC-4932). | 0.40 | Elena Rostova (Head of Insurance Systems) |
| Transactional Simplicity (ACID Guarantees) | Policy issuance, binding, and premium billing must commit atomically without distributed sagas. | 0.30 | David O'Reilly (Chief Architect) |
| Quoting Execution Latency (p99 <= 45 ms) | In-process calculation eliminates distributed network serialization and RPC roundtrips. | 0.15 | Consumer Underwriting SLA |
| Infrastructure Cost Efficiency | Single-codebase deployment minimizes cloud orchestration and compute expenditure. | 0.15 | Corporate FinOps Charter |
Alternatives rejected
| Option | Why it was not taken | Under what evidence it would win |
|---|---|---|
| 14 Distributed Microservices | Caused INC-4932 ($1.4M waste, 18-minute deployment freezes); team of 24 too small to absorb SRE tax. | Enterprise with 150+ developers and 15 dedicated platform/SRE engineers. |
| Serverless Lambda Architecture | Cold starts (> 2,500 ms) violate the 45ms quoting SLA; vendor lock-in on AWS proprietary APIs. | Ephemeral, low-volume event processing with long idle periods between runs. |
| Unified Stateless Monolith (Chosen) | Retains selection; zero network latency tax, single deployment pipeline, atomic database commits. | Cohesive domain applications maintained by high-velocity teams under 30 developers. |
Contracts and Invariants
Single Deployment Artifact Mandate [INV-MONO-01]
The entire platform must build into a single deployable container artifact.
Splitting services into separate deployment pipelines without Architecture Board sign-off is prohibited.
Stateless Compute Task Scaling [INV-MONO-02]
Monolith compute containers must be completely stateless. Storing session state, uploaded files,
or shared locks in local container memory or local disk across requests is strictly prohibited.
Connection Pool Concurrency Bounds [INV-MONO-03]
Each monolith container task must bound its database connection pool (HikariCP) to maximum 25 connections.
Unbounded connection pooling that threatens database exhaustion under autoscaling is barred.
Ownership and Handoffs
| Concern | Owner | Handoff payload | Blocked until |
|---|---|---|---|
| Monolith Architecture & Scaling Sizing | Chief Architect (David O'Reilly) | monolith_architecture_spec | Architecture board sign-off |
| Insurance Business Rules & Rating Engine | Head of Insurance Systems (Elena Rostova) | underwriting_actuarial_spec | Actuarial committee approval |
| Database Scaling & Read-Replica Topology | Lead Database Administrator | aurora_postgres_cluster_config | Terraform staging release |
| Zero-Downtime Blue-Green Deployment Pipeline | DevOps Engineering Team | gitlab_ecs_deployment_pipeline | Staging blue-green validation |
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| 24 developers across 3 product squads | provided | Engineering org intake | Current |
| 3.8 million active policyholders | provided | Business scope intake | Current |
| Peak 4,200 quote calculations/sec | provided | Volumetric traffic profile | Current |
| Incident INC-4932 18-min pipeline freeze ($1.4M) | provided | Retrospective post-mortem | Historical |
| Quoting latency budget p99 <= 45 ms | provided | Consumer Underwriting SLA | Current |
| Unified Monolith on ECS selected over Microservices | decided | David O'Reilly & Elena Rostova | 2026-09-15 |
| Max 25 database connections per task | decided | Architectural invariant INV-MONO-03 | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Reviewer self-check against monolith architecture standards:
- Pragmatic Sizing: PASS. Unified monolith perfectly matches 24-developer organizational scale.
- Performance Execution: PASS. In-process actuarial rating engine easily satisfies sub-45ms p99 SLA.
- Horizontal Elasticity: PASS. Stateless compute tasks scale horizontally from 4 to 20 tasks under load.
- Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to
rule_markdown.md.
Open Decisions
DEC-MONO-01: David O'Reilly to determine whether Redis should be introduced for centralized distributed HTTP session caching across ECS tasks or if stateless JWT bearer tokens suffice (Owner: David O'Reilly).
Next steps
- DevOps team establishes the blue-green deployment pipeline for the unified ECS container task.
- Database team provisions the Aurora PostgreSQL 16 cluster with 2 read-replicas.
- Conduct staging load drill scaling ECS tasks from 4 to 16 instances under 4,200 req/sec to verify zero database connection exhaustion.
skill: monolith-architect
Auto Insurance Monolith Architecture — Fitness Self-Check [MONOARCH-FIT-001]
Summary
This fitness self-check evaluates the monolith architecture against three critical red-capable domain failure probes: anemic model, cross-context transaction, and duplicate language. All targeted probes pass by design construction. A self-check is supporting evidence, never the authoritative gate. Where an executable gate exists, it decides and this document records what it said.
Detailed Description
| Criterion [FIT-n] | Probe | Evidence | Result | Limits of the claim |
|---|---|---|---|---|
| FIT-1: Anemic Model | Seed a policy underwriting service that modifies customer premium tables directly via JDBC queries without instantiating the actuarial rating domain model. | ArchUnit boundary probe probe_anemic_database_write_rejection verifying build failure on raw database updates outside domain entities with diagnostic ERR_BYPASSED_DOMAIN_RATING_MODEL. | pass | Confirms Java compile-time encapsulation; does not inspect ad-hoc manual SQL commands. |
| FIT-2: Cross-Context Transaction | Seed an un-governed background job that initiates an open-ended database transaction locking policy records for > 15 seconds while waiting for an external payment gateway HTTP call. | Connection pool transaction watchdog probe_long_running_transaction_abort verifying transaction termination with diagnostic ERR_TRANSACTION_LOCK_TIMEOUT_EXCEEDED. | pass | Confirms database transaction timeout parameter groups; does not evaluate OS-level process pauses. |
| FIT-3: Duplicate Language | Seed a package defining an ambiguous Account class that conflates policyholder billing accounts with insurance agency producer accounts. | Schema vocabulary validator probe_monolith_vocabulary_collision verifying build failure on ambiguous domain model classes with diagnostic ERR_AMBIGUOUS_MONOLITH_VOCABULARY. | pass | Confirms domain package naming rules; does not inspect internal code comments. |
Residual Risk
- Increased deployment blast radius where a fatal error in the claims module requires deploying a hotfix to the entire unified application container. Accepted by Elena Rostova with automated blue-green rollback tooling.
Traceability
| Claim | Classification | Source | Freshness |
|---|---|---|---|
| Rejection of bypassed rating models | derived | FIT-1 probe result | 2026-09-15 |
| Rejection of long-running locking transactions | derived | FIT-2 probe result | 2026-09-15 |
| Rejection of ambiguous domain vocabulary | derived | FIT-3 probe result | 2026-09-15 |
Verification
No validator was supplied, so no command was run.
Open Decisions
None.
Next steps
- DevOps team incorporates ArchUnit boundary checks into master CI deployment verification.
- Platform team configures Prometheus alerts monitoring ECS task CPU utilization and database connection pool waits.
- Conduct quarterly architectural review assessing monolith codebase size and module coupling.
Connects securely to your tools. The creator never sees your data.
What you get
About this skill
What it does
This skill owns the application-level decision to keep multiple capabilities inside one deployable and runtime lifecycle. It defines the enclosing boundary, responsibilities, internal calls, data and transaction authority, runtime/resource model, deployment and rollback unit, failure blast radius, scaling constraints, operational ownership, and conditions for internal modularization or extraction.
Use it when
- Multiple capabilities intentionally share one process, artifact, deployment, rollback, configuration, scaling and operational lifecycle
- A new application needs a monolith versus distributed-services decision grounded in current forces
- An existing monolith needs an application boundary, responsibility map, runtime flows, data/transaction model and operational contract
- Shared transactions or in-process calls are valuable, but coupling and ownership consequences need explicit review
- One workload, dependency or failure can affect the whole application and containment must be designed without premature distribution
- Vertical versus horizontal scaling, background work, concurrency, scheduling or resource contention must be assessed inside one deployable
For example: “We're a four-person team with an eighteen-month runway. An advisor told us our monolith is technical debt and we should split it now.”
What you get
- architecture/monolith-architect/README.md
- architecture/monolith-architect/00-overview/monolith-architect-overview.md
- architecture/monolith-architect/verification/fitness-self-check.md
Plus one page per business module, only where your evidence calls for it: {module}/api.md, {module}/events.md, {module}/clients.md, {module}/data.md, {module}/security.md, {module}/observability.md, {module}/resilience.md.
All paths are relative to the output folder you choose.
What it will not do
Do not use for module design alone, modular-monolith enforcement, one backend component, microservice decomposition already decided, deployment configuration, database schema, or choosing a framework because words such as monolith, simple, unified codebase, prototype, legacy, or single service appear.
How it works
- Check enforced internal boundaries are not required.
- Be explicit that this is a deliberate choice.
- Keep the internal structure navigable.
- Protect the build and test loop.
- State the extraction path.
- Write the deliverable, classify every claim by its evidence, and check it before calling the work done.
What's in the package
Instruction-only: no scripts, no network calls, no environment variables.
- LICENSE.txt
- SKILL.md
- agents/openai.yaml
- assets/output-template-artifact.md
- assets/output-template-contract.md
- assets/output-template-domain.md
- assets/output-template-fitness.md
- assets/output-template-mechanism.md
- references/domain-rules.md
- references/operating-rules.md
- references/output-contract.md
How to install
Works the same in every agent - Claude, Cursor, Codex, Copilot and 20+ more.
- 1
Download the ZIP
Free skills download straight away. Paid skills unlock right after purchase.
- 2
Unzip into your skills folder
Every agent reads skills from one folder on your machine. Drop the unzipped folder in there.
- 3
Ask your agent to use it
Restart the agent if it was already running. It picks the skill up automatically - no config needed.
Skills folder by agent
Click the path to copy it. Create the folder if it does not exist yet.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill passes our trust checks below.
Security scanned
Passed our 8-point scan before listing
Fresh listing
Recently published to Agensi
30-day refund
Not a fit? Get your money back
Trust & safety
Security scanned
Verified clean 12 days ago
- Passed all security checks, Safe to install