[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M70JAGAKMEAEY2E3KTRBA29A":3,"skill-same:01M70JAGAKMEAEY2E3KTRBA29A":100},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":31,"publishedAt":52,"linkOnly":53,"markdownContent":54,"markdownBody":55,"frontMatter":56,"refName":78,"commitSha":79,"skillDirectory":80,"forksCount":81,"repositoryHtmlUrl":82,"repositoryHomepageUrl":6,"ownerHtmlUrl":83,"ownerBlogUrl":6,"ownerDescription":84,"updatedAt":85,"install":86,"resources":99},"01M70JAGAKMEAEY2E3KTRBA29A","system-architecture-design",null,"Master engineering blueprint for macro-level system architecture design, capacity estimation, architectural paradigm evaluation, and selective service decomposition. Synthesizes canonical methodologies of Martin Fowler (In-Process Modular Monoliths & Strangler Fig), Sam Newman (Out-of-Process Service Decomposition & Internal RPC Interfaces), Alex Xu (Back-of-the-Envelope Capacity Estimation & Multi-Tier Topology), and Chris Richardson (Subdomain Decomposition & Polyglot Persistence) into an authoritative system design framework.","mdnaimul22\u002Fhuman-skills","mdnaimul22","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F64520358?v=4","01M70FH95MH2H796Q01TYSFZ03","Naimul","01M70FH96798CQR4YHA13F17GA",3,"MIT","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Fsystem-architecture-design\u002FSKILL.md",[18,23,28],{"categoryNo":19,"categoryName":20,"taxonomyType":21,"taxonomyTypeDesc":22},"01JBSEEDCAT000000000000015","视觉设计","SCENARIO","使用场景",{"categoryNo":24,"categoryName":25,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000030","开发工程师","PROFESSION","适用职业",{"categoryNo":29,"categoryName":30,"taxonomyType":26,"taxonomyTypeDesc":27},"01JBSEEDCAT000000000000032","设计师",[32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],"design","architecture","system","system architecture design","architecture design","extraction","engineering","high","fig","for","macro","topology","master","software","Evaluation","strangler fig","modular","service extraction","calculation","system design","2026-11-10 10:12:30",false,"---\nname: \"system-architecture-design\"\ndescription: \"Master engineering blueprint for macro-level system architecture design, capacity estimation, architectural paradigm evaluation, and selective service decomposition. Synthesizes canonical methodologies of Martin Fowler (In-Process Modular Monoliths & Strangler Fig), Sam Newman (Out-of-Process Service Decomposition & Internal RPC Interfaces), Alex Xu (Back-of-the-Envelope Capacity Estimation & Multi-Tier Topology), and Chris Richardson (Subdomain Decomposition & Polyglot Persistence) into an authoritative system design framework.\"\nversion: \"1.0.0\"\nauthor: \"Antigravity Engineering Core\"\ntags: [\"system-design\", \"software-architecture\", \"modular-monolith\", \"service-decomposition\", \"capacity-planning\", \"martin-fowler\", \"sam-newman\", \"alex-xu\", \"chris-richardson\", \"internal-api\", \"grpc\", \"polyglot-persistence\"]\ntrigger_patterns:\n  - \"system design\"\n  - \"system architecture design\"\n  - \"high level design\"\n  - \"modular monolith architecture\"\n  - \"service extraction\"\n  - \"capacity estimation\"\n  - \"back of the envelope calculation\"\n  - \"macro architecture\"\n---\n\n# Master System Architecture Design & Selective Decomposition Methodology\n\n> *\"Architecture is the decisions that you wish you could get right early in a project, but that are not necessarily easy to change later. A well-designed system prioritizes high-cohesion in-process modularity first, extracting out-of-process services only when concrete operational drivers demand it.\"*\n\n---\n\n## 1. Scope & Macro-Architecture Hierarchy\n\nThis skill provides the **Tier 1 Macro-Architecture Framework** for software systems engineering. It establishes the global blueprint of an application before individual service topologies or internal worker state machines are implemented.\n\n### The 3-Tier Systems Engineering Suite:\n\n```mermaid\nflowchart TD\n    subgraph Tier1[\"Tier 1: Global System Architecture (This Skill)\"]\n        T1[\"system-architecture-design\"]\n        T1 --> A1[\"Functional & Non-Functional Requirements (SLAs)\"]\n        T1 --> A2[\"Capacity & Traffic Estimation (Alex Xu Standard)\"]\n        T1 --> A3[\"Architectural Style: Modular Monolith vs Distributed\"]\n        T1 --> A4[\"Selective Service Decomposition Decision Matrix\"]\n    end\n\n    subgraph Tier2[\"Tier 2: Distributed Inter-Service Fabric\"]\n        T2[\"system-microservices-design\"]\n        T2 --> B1[\"DDD Bounded Contexts & Pact Contracts\"]\n        T2 --> B2[\"Saga Orchestration & Outbox CDC\"]\n        T2 --> B3[\"Envoy Mesh, Ingress & Resiliency (Circuit Breaker)\"]\n    end\n\n    subgraph Tier3[\"Tier 3: Sub-Atomic Component Lifecycle\"]\n        T3[\"system-lifecycle-designer\"]\n        T3 --> C1[\"3-Way Differential State Reconciliation\"]\n        T3 --> C2[\"Sticky Resource Leasing & Free Pools\"]\n        T3 --> C3[\"State Machine: Ingested ➔ Active ➔ Drain ➔ Tombstone\"]\n        T3 --> C4[\"Transactional Multi-File Atomic Shadow Swap\"]\n    end\n\n    Tier1 -- \"When out-of-process services are extracted\" --> Tier2\n    Tier2 -- \"When implementing individual service workers\u002Fpods\" --> Tier3\n    Tier1 -- \"When implementing in-process modules\u002Fdaemons\" --> Tier3\n```\n\n---\n\n## 2. Foundational Pillars of the Four Pioneers\n\nEvery high-level system architecture governed by this skill adheres to the empirical standards established by four foundational authorities:\n\n```mermaid\nquadrantChart\n    title High-Level System Architecture Pillars\n    x-axis \"Analytical \u002F Quantitative Planning\" --> \"Qualitative \u002F Structural Design\"\n    y-axis \"Runtime Infrastructure & Ingress\" --> \"Domain Boundaries & Modularity\"\n    quadrant-1 \"Martin Fowler (In-Process Modular Monolith)\"\n    quadrant-2 \"Sam Newman (Selective Service Decomposition)\"\n    quadrant-3 \"Alex Xu (Capacity Estimation & Ingress Topology)\"\n    quadrant-4 \"Chris Richardson (Subdomain Decomposition & Persistence)\"\n    \"Alex Xu: Capacity & Ingress\": [0.25, 0.30]\n    \"Chris Richardson: Subdomain Persistence\": [0.75, 0.35]\n    \"Sam Newman: Extraction Drivers\": [0.30, 0.80]\n    \"Martin Fowler: Modular Monolith\": [0.80, 0.85]\n```\n\n### 1. Alex Xu — Quantitative Capacity Estimation & Multi-Tier Topology\n- **Back-of-the-Envelope Estimation:** Quantitative analysis of Daily Active Users (DAU), Read-to-Write ratios, Queries Per Second (QPS), Network Bandwidth, and multi-year storage projections prior to selecting technologies.\n- **Multi-Tier Edge Ingress:** Layer 4\u002FLayer 7 load balancing, GeoDNS routing, CDN caching for static and dynamic assets, and unified API Gateway rate limiting.\n\n### 2. Martin Fowler — Componentization & In-Process Modularity\n- **Modular Monolith Priority:** Software is divided into logically distinct, high-cohesion, low-coupling modules running inside a single process boundary.\n- **Encapsulated In-Process Boundaries:** Modules expose public interface contracts (Facades) and communicate in-memory. Cross-module direct table queries or private class mutations are strictly forbidden.\n- **Strangler Fig Pattern:** Evolutionary migration strategy that intercepts calls to legacy boundaries and routes them to new modules or extracted services without total system rewrites.\n\n### 3. Sam Newman — Selective Service Decomposition\n- **Operational Drivers for Extraction:** Services are not extracted based on code organization; they are extracted strictly when forced by operational variance (e.g., asymmetric scaling, compute heterogeneity, independent release cycles, fault isolation).\n- **Internal Private RPC:** Extracted out-of-process services communicate with the core system over dedicated private networks using high-performance, strongly-typed internal RPC protocols (gRPC \u002F HTTP\u002F2 multiplexing) or asynchronous event streams.\n\n### 4. Chris Richardson — Subdomain Decomposition & Polyglot Persistence\n- **Domain-Driven Subdomain Classification:**\n  - *Core Domain:* Primary competitive business logic.\n  - *Supporting Subdomain:* Complements the core domain (e.g., inventory catalog, notification dispatch).\n  - *Generic Subdomain:* Standardized industry workflows (e.g., identity, billing, analytics).\n- **Polyglot Storage Strategy:** Selecting datastores strictly aligned with data access patterns (Relational RDBMS for transactional consistency, In-Memory Key-Value for low-latency caching, Columnar for analytical aggregation, Object Store for immutable blobs).\n\n---\n\n## 3. Quantitative Capacity Estimation Formulation (Alex Xu Standard)\n\nBefore producing structural diagrams, compute quantitative load metrics using the standard estimation pipeline:\n\n```mermaid\nflowchart LR\n    DAU[\"1. User Demand\\n(DAU \u002F Concurrent Users)\"] --> QPS[\"2. Throughput\\n(Average & Peak QPS)\"]\n    QPS --> Bandwidth[\"3. Network\\n(Ingress \u002F Egress Gbps)\"]\n    QPS --> Storage[\"4. Persistence\\n(Storage Growth \u002F 5 Years)\"]\n    Storage --> Cache[\"5. In-Memory Sizing\\n(80\u002F20 Working Set RAM)\"]\n```\n\n### Mathematical Formulation Matrix:\n\n| Metric | Calculation Formula | Target Standard |\n| :--- | :--- | :--- |\n| **Average QPS** | $\\text{QPS}_{\\text{avg}} = \\frac{\\text{DAU} \\times \\text{Requests per User per Day}}{86,400\\text{ seconds}}$ | Baseline operational traffic |\n| **Peak QPS** | $\\text{QPS}_{\\text{peak}} = \\text{QPS}_{\\text{avg}} \\times 2.0$ (or industry stress factor) | Infrastructure sizing boundary |\n| **Read\u002FWrite Split** | Allocate based on domain profile (e.g., $90:10$ for Social\u002FContent, $50:50$ for Financial\u002FIoT) | Determines cache and replication strategy |\n| **Network Egress** | $\\text{Bandwidth} = \\text{QPS}_{\\text{peak}} \\times \\text{Average Payload Size}$ | Evaluates CDN offload and NIC constraints |\n| **Storage (5 Years)** | $\\text{Storage}_{\\text{5yr}} = \\text{Daily Writes} \\times \\text{Payload Size} \\times 365 \\times 5 \\times 1.4$ (40% buffer for indexes\u002Fmetadata) | Disk capacity & sharding threshold |\n| **Memory Cache Size** | Apply Pareto Principle (80\u002F20 Rule): Cache $20\\%$ of daily read volume | RAM requirement for in-memory caching tier |\n\n---\n\n## 4. Architectural Paradigms & Structural Topology\n\n```mermaid\nflowchart TD\n    subgraph ClientLayer[\"Edge & Client Tier\"]\n        Client[\"Web \u002F Mobile \u002F Public API Clients\"] --> Ingress[\"Global Ingress \u002F L7 Load Balancer\"]\n    end\n\n    Ingress --> CoreMonolith\n\n    subgraph CoreMonolith[\"Core System: Modular Monolith (In-Process)\"]\n        direction TB\n        subgraph ModAuth[\"Auth & Identity Module\"]\n            A_Core[\"Logic\"]\n        end\n        subgraph ModBilling[\"Billing & Subscription Module\"]\n            B_Core[\"Logic\"]\n        end\n        subgraph ModCatalog[\"Product \u002F Core Domain Module\"]\n            C_Core[\"Logic\"]\n        end\n        ModAuth \u003C== \"In-Memory Facade\\n(Zero Network Latency)\" ==> ModBilling\n        ModBilling \u003C== \"In-Memory Facade\" ==> ModCatalog\n    end\n\n    subgraph DecomposedServices[\"Extracted Out-of-Process Services (Dedicated Compute Hosts)\"]\n        direction TB\n        SvcTranscode[\"Heavy Processing Service\\n(Media Transcoder \u002F Ingestion Engine)\"]\n        SvcAI[\"Machine Learning Inference Service\\n(GPU-Accelerated Cluster)\"]\n        SvcRealtime[\"Real-time Streaming Gateway\\n(High-Concurrency WebSocket Node)\"]\n    end\n\n    CoreMonolith -- \"Private Internal gRPC \u002F mTLS\\n(Synchronous Fast-Path)\" --> SvcTranscode\n    CoreMonolith -- \"Private Internal gRPC \u002F mTLS\" --> SvcAI\n    CoreMonolith -- \"Asynchronous Message Bus\\n(Kafka \u002F RabbitMQ)\" --> SvcRealtime\n\n    CoreDB[(\"Core RDBMS (PostgreSQL)\\nIsolated Schemas: auth.*, billing.*, catalog.*\")] --- CoreMonolith\n    SvcTranscode --- ScratchStorage[(\"Worker Scratch Store \u002F NVMe\")]\n```\n\n---\n\n## 5. Selective Service Decomposition Decision Framework\n\nDo not decompose monolithic systems based on intuition or organizational trends. Evaluate candidate domains against the **5 Canonical Extraction Drivers** (Sam Newman & Martin Fowler standard):\n\n```mermaid\nflowchart TD\n    Start[\"Candidate Domain Module\"] --> D1{\"1. Divergent Scaling Vector?\\n(Traffic magnitude 10x-100x higher than core)\"}\n    D1 -- Yes --> Extract[\"Decompose to Out-of-Process Service\"]\n    D1 -- No --> D2{\"2. Specialized Hardware Required?\\n(GPU, High NVMe IOPS, Memory-only instances)\"}\n    D2 -- Yes --> Extract\n    D2 -- No --> D3{\"3. Blast-Radius & Fault Isolation?\\n(Untrusted third-party, crash-prone computations)\"}\n    D3 -- Yes --> Extract\n    D3 -- No --> D4{\"4. Asymmetric Deployment Cadence?\\n(Requires 20 deploys\u002Fday vs 1 deploy\u002Fweek for core)\"}\n    D4 -- Yes --> Extract\n    D4 -- No --> D5{\"5. Strict Regulatory \u002F Security Boundary?\\n(PCI-DSS Cardholder Data, HIPAA PII isolation)\"}\n    D5 -- Yes --> Extract\n    D5 -- No --> Retain[\"Retain Inside Modular Monolith (In-Process Module)\"]\n```\n\n### Extraction Driver Analysis Matrix:\n\n| Driver | Description | Architectural Consequence |\n| :--- | :--- | :--- |\n| **Divergent Scaling** | Domain throughput exceeds core system by orders of magnitude (e.g., telemetry streaming vs account billing). | Isolates horizontal auto-scaling nodes without scaling the entire monolithic memory footprint. |\n| **Resource Heterogeneity** | Domain requires non-standard hardware profiles (e.g., CUDA GPU instances, extreme memory allocations). | Prevents costly over-provisioning of monolithic host infrastructure. |\n| **Fault Isolation** | High probability of unhandled crash, memory leak, or infinite loops (e.g., user-supplied scripts, video transcoding). | Protects core business uptime by containing fatal process terminations to an isolated host. |\n| **Deployment Cadence** | Autonomous team requires rapid iterations without coordinating full monolithic integration testing. | Enables decoupled CI\u002FCD pipelines and independent release schedules. |\n| **Regulatory Boundary** | Stringent compliance scopes auditing to a minimal infrastructure perimeter (e.g., PCI-DSS, SOC2). | Minimizes compliance audit scope and isolates sensitive network segments. |\n\n---\n\n## 6. Communication Protocols & Internal API Standards\n\nEnforce strict protocol differentiation based on the execution boundary:\n\n| Boundary Layer | Protocol | Wire Format | Transport Security | Network Scope |\n| :--- | :--- | :--- | :--- | :--- |\n| **Client to Gateway** | HTTPS \u002F HTTP\u002F2 | JSON \u002F REST | TLS 1.3 | Public Internet |\n| **In-Process Modules** | Direct Function Call | Native Memory | In-Process Memory | Zero Network (Host RAM) |\n| **Core to Extracted Service** | gRPC | Protocol Buffers (Protobuf) | Mutual TLS (mTLS) | Private VPC \u002F Internal Subnet |\n| **Asynchronous Events** | Kafka \u002F RabbitMQ | Avro \u002F Protobuf | SASL \u002F TLS | Private Message Broker |\n| **Real-time Push** | WebSocket \u002F SSE | Binary \u002F JSON | WSS (TLS) | Edge Ingress to Client |\n\n---\n\n## 7. Global Polyglot Storage Architecture\n\nData storage must be categorized by access pattern, consistency guarantee, and query complexity:\n\n```mermaid\nflowchart TD\n    App[\"Application Layer\\n(Core Monolith & Extracted Services)\"]\n    \n    App --> Relational[(\"Transactional Core\\n(PostgreSQL \u002F MySQL)\\n• ACID Transactions\\n• Schema-isolated per module\\n• Zero cross-module SQL joins\")]\n    App --> Cache[(\"Low-Latency Cache\\n(Redis Cluster)\\n• Sub-millisecond reads\\n• Cache-Aside pattern\\n• Distributed locking\")]\n    App --> Search[(\"Full-Text & Analytics\\n(Elasticsearch \u002F ClickHouse)\\n• Read-model projections (CQRS)\\n• Time-series telemetry\\n• Aggregation dashboards\")]\n    App --> ObjectStore[(\"Immutable Blob Storage\\n(S3-Compatible)\\n• User assets, media, backups\\n• Presigned upload URLs\")]\n```\n\n### Rules of Persistence Isolation:\n1. **Logical Schema Segregation in Core RDBMS:** \n   - When running inside the core modular monolith, distinct modules share the physical database engine but maintain dedicated schemas (`auth.users`, `billing.subscriptions`, `catalog.products`).\n   - Direct cross-schema SQL `JOIN` statements across module boundaries are strictly forbidden. Cross-module data queries must pass through the owning module's Public In-Process Facade.\n2. **Dedicated Datastores for Extracted Services:**\n   - Any out-of-process extracted service owns its private persistent datastore. Shared database access across network boundaries is prohibited.\n\n---\n\n## 8. The 20-Point System Architecture Audit Checklist\n\nBefore finalizing any macro-level system architecture, verify compliance against these 20 verifiable criteria:\n\n### A. Capacity & Quantified Requirements (Alex Xu)\n- [ ] 1. Functional requirements define clear inputs, processing triggers, and outputs.\n- [ ] 2. Non-Functional Requirements specify explicit SLAs: Latency (p95\u002Fp99), Availability (99.9% vs 99.99%), RPO, and RTO.\n- [ ] 3. Average and Peak QPS are computed from explicit DAU and read\u002Fwrite ratios.\n- [ ] 4. Multi-year storage growth accounts for payload size, indexing overhead, and metadata buffers.\n- [ ] 5. Cache memory sizing is calculated using Pareto's 80\u002F20 working-set rule.\n\n### B. In-Process Modularity (Martin Fowler)\n- [ ] 6. Core business domains reside within a strictly decoupled Modular Monolith.\n- [ ] 7. In-process modules communicate exclusively via explicit Public Interfaces\u002FFacades or in-memory events.\n- [ ] 8. Zero direct cross-module private class imports or internal repository calls.\n- [ ] 9. The database enforces logical schema separation per domain module.\n- [ ] 10. Cross-module SQL `JOIN` queries across domain schemas are strictly prohibited.\n\n### C. Out-of-Process Service Decomposition (Sam Newman)\n- [ ] 11. Every extracted service is justified by at least one of the 5 Canonical Extraction Drivers.\n- [ ] 12. Decomposed services are deployed independently without requiring synchronized core deployments.\n- [ ] 13. Core-to-service communication traverses private subnets using strongly-typed gRPC\u002FProtobuf.\n- [ ] 14. Network calls between core and extracted services enforce strict deadlines and connection timeouts.\n- [ ] 15. The core system implements graceful degradation if an extracted service becomes unreachable.\n\n### D. Data & Storage Strategy (Chris Richardson)\n- [ ] 16. Persistent datastores are matched to access patterns (RDBMS, In-Memory Cache, Columnar, Object Storage).\n- [ ] 17. Extracted services do not share physical database connections with the core monolith.\n- [ ] 18. Complex analytical reporting is offloaded from transactional tables to specialized read replicas or search indexes.\n\n### E. Multi-Tier Ingress & Security (Alex Xu)\n- [ ] 19. Public internet traffic terminates at an Edge Ingress\u002FLoad Balancer with Token Bucket rate limiting.\n- [ ] 20. Out-of-process services reside within private subnets inaccessible from the public internet.\n\n---\n\n## 9. Implementation Handoff to Tier 2 & Tier 3\n\nWhen the macro architecture design is established:\n1. **If out-of-process distributed services are defined:**\n   - Delegate distributed transaction, Saga orchestration, and Envoy mesh design to **`system-microservices-design`**.\n2. **When implementing code for individual workers, daemons, or modules:**\n   - Delegate state reconciliation, sticky leasing, atomic file swaps, and graceful draining to **`system-lifecycle-designer`**.\n","# Master System Architecture Design & Selective Decomposition Methodology\n\n> *\"Architecture is the decisions that you wish you could get right early in a project, but that are not necessarily easy to change later. A well-designed system prioritizes high-cohesion in-process modularity first, extracting out-of-process services only when concrete operational drivers demand it.\"*\n\n---\n\n## 1. Scope & Macro-Architecture Hierarchy\n\nThis skill provides the **Tier 1 Macro-Architecture Framework** for software systems engineering. It establishes the global blueprint of an application before individual service topologies or internal worker state machines are implemented.\n\n### The 3-Tier Systems Engineering Suite:\n\n```mermaid\nflowchart TD\n    subgraph Tier1[\"Tier 1: Global System Architecture (This Skill)\"]\n        T1[\"system-architecture-design\"]\n        T1 --> A1[\"Functional & Non-Functional Requirements (SLAs)\"]\n        T1 --> A2[\"Capacity & Traffic Estimation (Alex Xu Standard)\"]\n        T1 --> A3[\"Architectural Style: Modular Monolith vs Distributed\"]\n        T1 --> A4[\"Selective Service Decomposition Decision Matrix\"]\n    end\n\n    subgraph Tier2[\"Tier 2: Distributed Inter-Service Fabric\"]\n        T2[\"system-microservices-design\"]\n        T2 --> B1[\"DDD Bounded Contexts & Pact Contracts\"]\n        T2 --> B2[\"Saga Orchestration & Outbox CDC\"]\n        T2 --> B3[\"Envoy Mesh, Ingress & Resiliency (Circuit Breaker)\"]\n    end\n\n    subgraph Tier3[\"Tier 3: Sub-Atomic Component Lifecycle\"]\n        T3[\"system-lifecycle-designer\"]\n        T3 --> C1[\"3-Way Differential State Reconciliation\"]\n        T3 --> C2[\"Sticky Resource Leasing & Free Pools\"]\n        T3 --> C3[\"State Machine: Ingested ➔ Active ➔ Drain ➔ Tombstone\"]\n        T3 --> C4[\"Transactional Multi-File Atomic Shadow Swap\"]\n    end\n\n    Tier1 -- \"When out-of-process services are extracted\" --> Tier2\n    Tier2 -- \"When implementing individual service workers\u002Fpods\" --> Tier3\n    Tier1 -- \"When implementing in-process modules\u002Fdaemons\" --> Tier3\n```\n\n---\n\n## 2. Foundational Pillars of the Four Pioneers\n\nEvery high-level system architecture governed by this skill adheres to the empirical standards established by four foundational authorities:\n\n```mermaid\nquadrantChart\n    title High-Level System Architecture Pillars\n    x-axis \"Analytical \u002F Quantitative Planning\" --> \"Qualitative \u002F Structural Design\"\n    y-axis \"Runtime Infrastructure & Ingress\" --> \"Domain Boundaries & Modularity\"\n    quadrant-1 \"Martin Fowler (In-Process Modular Monolith)\"\n    quadrant-2 \"Sam Newman (Selective Service Decomposition)\"\n    quadrant-3 \"Alex Xu (Capacity Estimation & Ingress Topology)\"\n    quadrant-4 \"Chris Richardson (Subdomain Decomposition & Persistence)\"\n    \"Alex Xu: Capacity & Ingress\": [0.25, 0.30]\n    \"Chris Richardson: Subdomain Persistence\": [0.75, 0.35]\n    \"Sam Newman: Extraction Drivers\": [0.30, 0.80]\n    \"Martin Fowler: Modular Monolith\": [0.80, 0.85]\n```\n\n### 1. Alex Xu — Quantitative Capacity Estimation & Multi-Tier Topology\n- **Back-of-the-Envelope Estimation:** Quantitative analysis of Daily Active Users (DAU), Read-to-Write ratios, Queries Per Second (QPS), Network Bandwidth, and multi-year storage projections prior to selecting technologies.\n- **Multi-Tier Edge Ingress:** Layer 4\u002FLayer 7 load balancing, GeoDNS routing, CDN caching for static and dynamic assets, and unified API Gateway rate limiting.\n\n### 2. Martin Fowler — Componentization & In-Process Modularity\n- **Modular Monolith Priority:** Software is divided into logically distinct, high-cohesion, low-coupling modules running inside a single process boundary.\n- **Encapsulated In-Process Boundaries:** Modules expose public interface contracts (Facades) and communicate in-memory. Cross-module direct table queries or private class mutations are strictly forbidden.\n- **Strangler Fig Pattern:** Evolutionary migration strategy that intercepts calls to legacy boundaries and routes them to new modules or extracted services without total system rewrites.\n\n### 3. Sam Newman — Selective Service Decomposition\n- **Operational Drivers for Extraction:** Services are not extracted based on code organization; they are extracted strictly when forced by operational variance (e.g., asymmetric scaling, compute heterogeneity, independent release cycles, fault isolation).\n- **Internal Private RPC:** Extracted out-of-process services communicate with the core system over dedicated private networks using high-performance, strongly-typed internal RPC protocols (gRPC \u002F HTTP\u002F2 multiplexing) or asynchronous event streams.\n\n### 4. Chris Richardson — Subdomain Decomposition & Polyglot Persistence\n- **Domain-Driven Subdomain Classification:**\n  - *Core Domain:* Primary competitive business logic.\n  - *Supporting Subdomain:* Complements the core domain (e.g., inventory catalog, notification dispatch).\n  - *Generic Subdomain:* Standardized industry workflows (e.g., identity, billing, analytics).\n- **Polyglot Storage Strategy:** Selecting datastores strictly aligned with data access patterns (Relational RDBMS for transactional consistency, In-Memory Key-Value for low-latency caching, Columnar for analytical aggregation, Object Store for immutable blobs).\n\n---\n\n## 3. Quantitative Capacity Estimation Formulation (Alex Xu Standard)\n\nBefore producing structural diagrams, compute quantitative load metrics using the standard estimation pipeline:\n\n```mermaid\nflowchart LR\n    DAU[\"1. User Demand\\n(DAU \u002F Concurrent Users)\"] --> QPS[\"2. Throughput\\n(Average & Peak QPS)\"]\n    QPS --> Bandwidth[\"3. Network\\n(Ingress \u002F Egress Gbps)\"]\n    QPS --> Storage[\"4. Persistence\\n(Storage Growth \u002F 5 Years)\"]\n    Storage --> Cache[\"5. In-Memory Sizing\\n(80\u002F20 Working Set RAM)\"]\n```\n\n### Mathematical Formulation Matrix:\n\n| Metric | Calculation Formula | Target Standard |\n| :--- | :--- | :--- |\n| **Average QPS** | $\\text{QPS}_{\\text{avg}} = \\frac{\\text{DAU} \\times \\text{Requests per User per Day}}{86,400\\text{ seconds}}$ | Baseline operational traffic |\n| **Peak QPS** | $\\text{QPS}_{\\text{peak}} = \\text{QPS}_{\\text{avg}} \\times 2.0$ (or industry stress factor) | Infrastructure sizing boundary |\n| **Read\u002FWrite Split** | Allocate based on domain profile (e.g., $90:10$ for Social\u002FContent, $50:50$ for Financial\u002FIoT) | Determines cache and replication strategy |\n| **Network Egress** | $\\text{Bandwidth} = \\text{QPS}_{\\text{peak}} \\times \\text{Average Payload Size}$ | Evaluates CDN offload and NIC constraints |\n| **Storage (5 Years)** | $\\text{Storage}_{\\text{5yr}} = \\text{Daily Writes} \\times \\text{Payload Size} \\times 365 \\times 5 \\times 1.4$ (40% buffer for indexes\u002Fmetadata) | Disk capacity & sharding threshold |\n| **Memory Cache Size** | Apply Pareto Principle (80\u002F20 Rule): Cache $20\\%$ of daily read volume | RAM requirement for in-memory caching tier |\n\n---\n\n## 4. Architectural Paradigms & Structural Topology\n\n```mermaid\nflowchart TD\n    subgraph ClientLayer[\"Edge & Client Tier\"]\n        Client[\"Web \u002F Mobile \u002F Public API Clients\"] --> Ingress[\"Global Ingress \u002F L7 Load Balancer\"]\n    end\n\n    Ingress --> CoreMonolith\n\n    subgraph CoreMonolith[\"Core System: Modular Monolith (In-Process)\"]\n        direction TB\n        subgraph ModAuth[\"Auth & Identity Module\"]\n            A_Core[\"Logic\"]\n        end\n        subgraph ModBilling[\"Billing & Subscription Module\"]\n            B_Core[\"Logic\"]\n        end\n        subgraph ModCatalog[\"Product \u002F Core Domain Module\"]\n            C_Core[\"Logic\"]\n        end\n        ModAuth \u003C== \"In-Memory Facade\\n(Zero Network Latency)\" ==> ModBilling\n        ModBilling \u003C== \"In-Memory Facade\" ==> ModCatalog\n    end\n\n    subgraph DecomposedServices[\"Extracted Out-of-Process Services (Dedicated Compute Hosts)\"]\n        direction TB\n        SvcTranscode[\"Heavy Processing Service\\n(Media Transcoder \u002F Ingestion Engine)\"]\n        SvcAI[\"Machine Learning Inference Service\\n(GPU-Accelerated Cluster)\"]\n        SvcRealtime[\"Real-time Streaming Gateway\\n(High-Concurrency WebSocket Node)\"]\n    end\n\n    CoreMonolith -- \"Private Internal gRPC \u002F mTLS\\n(Synchronous Fast-Path)\" --> SvcTranscode\n    CoreMonolith -- \"Private Internal gRPC \u002F mTLS\" --> SvcAI\n    CoreMonolith -- \"Asynchronous Message Bus\\n(Kafka \u002F RabbitMQ)\" --> SvcRealtime\n\n    CoreDB[(\"Core RDBMS (PostgreSQL)\\nIsolated Schemas: auth.*, billing.*, catalog.*\")] --- CoreMonolith\n    SvcTranscode --- ScratchStorage[(\"Worker Scratch Store \u002F NVMe\")]\n```\n\n---\n\n## 5. Selective Service Decomposition Decision Framework\n\nDo not decompose monolithic systems based on intuition or organizational trends. Evaluate candidate domains against the **5 Canonical Extraction Drivers** (Sam Newman & Martin Fowler standard):\n\n```mermaid\nflowchart TD\n    Start[\"Candidate Domain Module\"] --> D1{\"1. Divergent Scaling Vector?\\n(Traffic magnitude 10x-100x higher than core)\"}\n    D1 -- Yes --> Extract[\"Decompose to Out-of-Process Service\"]\n    D1 -- No --> D2{\"2. Specialized Hardware Required?\\n(GPU, High NVMe IOPS, Memory-only instances)\"}\n    D2 -- Yes --> Extract\n    D2 -- No --> D3{\"3. Blast-Radius & Fault Isolation?\\n(Untrusted third-party, crash-prone computations)\"}\n    D3 -- Yes --> Extract\n    D3 -- No --> D4{\"4. Asymmetric Deployment Cadence?\\n(Requires 20 deploys\u002Fday vs 1 deploy\u002Fweek for core)\"}\n    D4 -- Yes --> Extract\n    D4 -- No --> D5{\"5. Strict Regulatory \u002F Security Boundary?\\n(PCI-DSS Cardholder Data, HIPAA PII isolation)\"}\n    D5 -- Yes --> Extract\n    D5 -- No --> Retain[\"Retain Inside Modular Monolith (In-Process Module)\"]\n```\n\n### Extraction Driver Analysis Matrix:\n\n| Driver | Description | Architectural Consequence |\n| :--- | :--- | :--- |\n| **Divergent Scaling** | Domain throughput exceeds core system by orders of magnitude (e.g., telemetry streaming vs account billing). | Isolates horizontal auto-scaling nodes without scaling the entire monolithic memory footprint. |\n| **Resource Heterogeneity** | Domain requires non-standard hardware profiles (e.g., CUDA GPU instances, extreme memory allocations). | Prevents costly over-provisioning of monolithic host infrastructure. |\n| **Fault Isolation** | High probability of unhandled crash, memory leak, or infinite loops (e.g., user-supplied scripts, video transcoding). | Protects core business uptime by containing fatal process terminations to an isolated host. |\n| **Deployment Cadence** | Autonomous team requires rapid iterations without coordinating full monolithic integration testing. | Enables decoupled CI\u002FCD pipelines and independent release schedules. |\n| **Regulatory Boundary** | Stringent compliance scopes auditing to a minimal infrastructure perimeter (e.g., PCI-DSS, SOC2). | Minimizes compliance audit scope and isolates sensitive network segments. |\n\n---\n\n## 6. Communication Protocols & Internal API Standards\n\nEnforce strict protocol differentiation based on the execution boundary:\n\n| Boundary Layer | Protocol | Wire Format | Transport Security | Network Scope |\n| :--- | :--- | :--- | :--- | :--- |\n| **Client to Gateway** | HTTPS \u002F HTTP\u002F2 | JSON \u002F REST | TLS 1.3 | Public Internet |\n| **In-Process Modules** | Direct Function Call | Native Memory | In-Process Memory | Zero Network (Host RAM) |\n| **Core to Extracted Service** | gRPC | Protocol Buffers (Protobuf) | Mutual TLS (mTLS) | Private VPC \u002F Internal Subnet |\n| **Asynchronous Events** | Kafka \u002F RabbitMQ | Avro \u002F Protobuf | SASL \u002F TLS | Private Message Broker |\n| **Real-time Push** | WebSocket \u002F SSE | Binary \u002F JSON | WSS (TLS) | Edge Ingress to Client |\n\n---\n\n## 7. Global Polyglot Storage Architecture\n\nData storage must be categorized by access pattern, consistency guarantee, and query complexity:\n\n```mermaid\nflowchart TD\n    App[\"Application Layer\\n(Core Monolith & Extracted Services)\"]\n    \n    App --> Relational[(\"Transactional Core\\n(PostgreSQL \u002F MySQL)\\n• ACID Transactions\\n• Schema-isolated per module\\n• Zero cross-module SQL joins\")]\n    App --> Cache[(\"Low-Latency Cache\\n(Redis Cluster)\\n• Sub-millisecond reads\\n• Cache-Aside pattern\\n• Distributed locking\")]\n    App --> Search[(\"Full-Text & Analytics\\n(Elasticsearch \u002F ClickHouse)\\n• Read-model projections (CQRS)\\n• Time-series telemetry\\n• Aggregation dashboards\")]\n    App --> ObjectStore[(\"Immutable Blob Storage\\n(S3-Compatible)\\n• User assets, media, backups\\n• Presigned upload URLs\")]\n```\n\n### Rules of Persistence Isolation:\n1. **Logical Schema Segregation in Core RDBMS:** \n   - When running inside the core modular monolith, distinct modules share the physical database engine but maintain dedicated schemas (`auth.users`, `billing.subscriptions`, `catalog.products`).\n   - Direct cross-schema SQL `JOIN` statements across module boundaries are strictly forbidden. Cross-module data queries must pass through the owning module's Public In-Process Facade.\n2. **Dedicated Datastores for Extracted Services:**\n   - Any out-of-process extracted service owns its private persistent datastore. Shared database access across network boundaries is prohibited.\n\n---\n\n## 8. The 20-Point System Architecture Audit Checklist\n\nBefore finalizing any macro-level system architecture, verify compliance against these 20 verifiable criteria:\n\n### A. Capacity & Quantified Requirements (Alex Xu)\n- [ ] 1. Functional requirements define clear inputs, processing triggers, and outputs.\n- [ ] 2. Non-Functional Requirements specify explicit SLAs: Latency (p95\u002Fp99), Availability (99.9% vs 99.99%), RPO, and RTO.\n- [ ] 3. Average and Peak QPS are computed from explicit DAU and read\u002Fwrite ratios.\n- [ ] 4. Multi-year storage growth accounts for payload size, indexing overhead, and metadata buffers.\n- [ ] 5. Cache memory sizing is calculated using Pareto's 80\u002F20 working-set rule.\n\n### B. In-Process Modularity (Martin Fowler)\n- [ ] 6. Core business domains reside within a strictly decoupled Modular Monolith.\n- [ ] 7. In-process modules communicate exclusively via explicit Public Interfaces\u002FFacades or in-memory events.\n- [ ] 8. Zero direct cross-module private class imports or internal repository calls.\n- [ ] 9. The database enforces logical schema separation per domain module.\n- [ ] 10. Cross-module SQL `JOIN` queries across domain schemas are strictly prohibited.\n\n### C. Out-of-Process Service Decomposition (Sam Newman)\n- [ ] 11. Every extracted service is justified by at least one of the 5 Canonical Extraction Drivers.\n- [ ] 12. Decomposed services are deployed independently without requiring synchronized core deployments.\n- [ ] 13. Core-to-service communication traverses private subnets using strongly-typed gRPC\u002FProtobuf.\n- [ ] 14. Network calls between core and extracted services enforce strict deadlines and connection timeouts.\n- [ ] 15. The core system implements graceful degradation if an extracted service becomes unreachable.\n\n### D. Data & Storage Strategy (Chris Richardson)\n- [ ] 16. Persistent datastores are matched to access patterns (RDBMS, In-Memory Cache, Columnar, Object Storage).\n- [ ] 17. Extracted services do not share physical database connections with the core monolith.\n- [ ] 18. Complex analytical reporting is offloaded from transactional tables to specialized read replicas or search indexes.\n\n### E. Multi-Tier Ingress & Security (Alex Xu)\n- [ ] 19. Public internet traffic terminates at an Edge Ingress\u002FLoad Balancer with Token Bucket rate limiting.\n- [ ] 20. Out-of-process services reside within private subnets inaccessible from the public internet.\n\n---\n\n## 9. Implementation Handoff to Tier 2 & Tier 3\n\nWhen the macro architecture design is established:\n1. **If out-of-process distributed services are defined:**\n   - Delegate distributed transaction, Saga orchestration, and Envoy mesh design to **`system-microservices-design`**.\n2. **When implementing code for individual workers, daemons, or modules:**\n   - Delegate state reconciliation, sticky leasing, atomic file swaps, and graceful draining to **`system-lifecycle-designer`**.\n",{"name":5,"tags":57,"author":70,"version":71,"description":7,"trigger_patterns":72},[58,59,60,61,62,63,64,65,66,67,68,69],"system-design","software-architecture","modular-monolith","service-decomposition","capacity-planning","martin-fowler","sam-newman","alex-xu","chris-richardson","internal-api","grpc","polyglot-persistence","Antigravity Engineering Core","1.0.0",[51,35,73,74,49,75,76,77],"high level design","modular monolith architecture","capacity estimation","back of the envelope calculation","macro architecture","main","1c3a5e1d7894fb6e3a473a45da896eb4a6550642","skills\u002Fstorage\u002Fmy_skills\u002Fsystem-architecture-design",0,"https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills","https:\u002F\u002Fgithub.com\u002Fmdnaimul22","AI Agents Workflows Automation | Specializing in Python, FastAPI, MCP Agents & Custom ERP.","2026-11-11 21:16:57",{"source":8,"skillName":5,"commands":87,"prompt":97,"zipAvailable":98},[88,91,94],{"tool":89,"command":90},"npx","npx skills add mdnaimul22\u002Fhuman-skills --skill system-architecture-design",{"tool":92,"command":93},"bunx","bunx skills add mdnaimul22\u002Fhuman-skills --skill system-architecture-design",{"tool":95,"command":96},"pnpm","pnpm dlx skills add mdnaimul22\u002Fhuman-skills --skill system-architecture-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Fsystem-architecture-design\u002FSKILL.md",true,[],[101,109,117,124,131,138],{"skillNo":102,"name":103,"nameZh":6,"description":104,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":105,"categories":106,"keywords":107,"publishedAt":108},"01M767791C1KRP2ZRW2Z73VZ5Q","system-lifecycle-designer","Universal architectural methodology for designing granular, atomic, and sub-atomic lifecycles and end-to-end workflows for single functionality integrations across any domain (daemons, batch jobs, request transactions, resource pools). Provides patterns for deterministic identity, pre-commit validation, differential reconciliation, sticky leasing, state machines, transactional persistence, and closed-loop feedback.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fmy_skills\u002Fsystem-lifecycle-designer\u002FSKILL.md",[],[],"2026-11-12 13:55:43",{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":116},"01M748ABPN5F1FANHH6HKZQMXT","style-sampling","Make a new episode in a proven video style - Collage Explainer, Finance Explainer, Animated Science Explainer, 3D Brand Explainer, 3D True Crime - on the person's topic. Use for \"an episode of\", \"in the style of\", \"sample this style\", 「用这个风格做一集」. One video to copy is reverse-any-video.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fheygen-com_hyperframes\u002Fstyle-sampling\u002FSKILL.md",[],[],"2026-11-11 15:11:14",{"skillNo":118,"name":119,"nameZh":6,"description":120,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":116},"01M748A59V04PKW4HA0XQ81FGP","reverse-any-video","Rebuild any video file as an editable HyperFrames project - motion graphics, talking heads, live action or AI-generated footage - checked against the original frame by frame. Use to reverse, recreate, remake, replicate or copy a video, or 「复刻这个视频」「照着这个视频做一个」.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Fheygen-com_hyperframes\u002Freverse-any-video\u002FSKILL.md",[],[],{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":116},"01M7487T50P55CSXMWXZ0G9KRG","typescript-patterns","TypeScript patterns for strict, type-safe, maintainable code in modern TypeScript and JavaScript applications. Covers strict compiler configuration, type design, narrowing, discriminated unions, generics, async and error handling, module boundaries, dependency hygiene, and type-level testing. Use when writing or reviewing TypeScript or JavaScript code.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Ftypescript-patterns\u002FSKILL.md",[],[],{"skillNo":132,"name":133,"nameZh":6,"description":134,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":135,"categories":136,"keywords":137,"publishedAt":116},"01M7487ERZRGPC5NJ75077Y238","test-collaboration","Inventory and govern a project's test assets. Connect requirements, business rules, risks, bugs, and cross-boundary contracts to stable TEST-IDs and executable evidence in the repository's existing test registry or TESTS.md. Use for test inventory, test gap analysis, unit\u002Fintegration\u002Fcontract\u002FE2E\u002Fsmoke classification, bug-to-test regression protection, consumer\u002Fprovider contract testing, test-necessity review, and pre-delivery evidence review.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Ftest-collaboration\u002FSKILL.md",[],[],{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":116},"01M748721J3GKR2WS6K0QWFC35","story-lifecycle","Manage a file-based epic → story → sprint development loop without requiring an external project management tool. Creates and tracks epics, breaks them into user stories, assigns them to sprints, and drives implementation story by story. Use when starting a new feature initiative or when the team has no Jira\u002FLinear\u002FTaiga but needs structured delivery tracking.","https:\u002F\u002Fgithub.com\u002Fmdnaimul22\u002Fhuman-skills\u002Fblob\u002Fmain\u002Fskills\u002Fstorage\u002Faffaan-m_ECC\u002Fstory-lifecycle\u002FSKILL.md",[],[]]