C4 Level 2 Container Diagram and Protocol Model

    1

    Models C4 Level 2 containers: deployable units, mTLS gRPC protocols, single-owner databases, and sub-45ms latency.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    C4 Level 2 Container Diagram and Protocol Model

    Example session with this skill installed

    Model formal C4 Level 2 Container Diagram, deployable runtime units, and datastores for Omnichannel Retail Banking.

    • Subject: omnichannel-retail-banking-system v3.0 (run-id: quote-contdiag-001) serving 24 million retail banking customers at 65,000 req/sec.
    • Deciders: Chief Enterprise Architect (David O'Reilly) and Head of Retail Banking Platforms (Elena Rostova).
    • Scope: C4 Level 2 decomposition into 6 containers (SPA, Mobile, Ingress Gateway, Core Ledger, Statement Worker, Notifications); mTLS gRPC; single-owner databases.
    • Tension: Combining API routing, core transaction posting, and PDF statement rendering into a single monolithic container caused memory crashes in incident CNT-4919 ($3.8M penalty). David O'Reilly and Elena Rostova mandate an authoritative C4 Container Diagram: isolated container boundaries, asynchronous Kafka decoupling, and single-owner persistence.

    Write the c4 container diagram mermaid plantuml under docs/.

    • Read your context and instructions
    • Compiled the c4 level 2

    Wrote docs/architecture/tasks/quote-contdiag-001/container-diagram/c4-container-diagram-mermaid-plantuml.md. Complete C4 Level 2 container diagram specification establishing deployable runtime boundaries, communication protocols, datastores, and inter-service security seams for omnichannel retail banking.


    skill: container-diagram

    C4 Level 2 Container Diagram Specification: Omnichannel Retail Banking [C4CONT-BANK-001]

    Summary

    This specification establishes the formal C4 Level 2 Container Diagram specification, deployable runtime unit boundaries, inter-container communication protocols, and physical datastore topologies for omnichannel-retail-banking-system v3.0 under run ID quote-contdiag-001. It governs distributed container architecture across 24 million active retail banking customers executing 65,000 requests/second across web, mobile, and branch channels. It decisively investigates and resolves the monolithic container coupling and deployment cascading outages demonstrated in incident CNT-4919 (where combining client API routing, core transaction posting, and PDF statement rendering into a single monolithic container caused statement generation memory spikes to crash the container runtime, taking down online banking for 4.2 hours and incurring $3.8M in merchant SLA penalties). The specification models the exact decomposition of the banking system into 6 isolated C4 Containers, enforces strict mTLS and gRPC communication protocols across internal container seams, establishes

    dedicated single-owner database boundaries, and provides

    executable Mermaid and PlantUML C4 container diagrams.

    Detailed Description

    Operating complex enterprise platforms as opaque, monolithic containers leads to severe resource contention, brittle deployments, and uncontained failure blast radiuses. When distinct business concerns (such as real-time payment clearing, async statement generation, and edge authentication) share a single deployable container, scaling one concern forces scaling everything, and a memory leak in a non-critical background worker crashes the core transaction processing path. C4 Level 2 Container Modeling establishes

    Architectural Runtime Decomposition: it zooms into the software system boundary to map individual deployable units (applications, microservice containers, mobile clients, serverless workers), documents exact network transport protocols (HTTPS, gRPC, Kafka wire protocols), models dedicated physical datastores (relational, cache, object storage), and defines runtime security perimeters.

    External Users: Mobile, Web, Branch Tellers (24 Million Customers)
                                   │
                                   ▼
    ┌─────────────────────────────────────────────────────────────────────────────┐
    │ Client Applications Tier: iOS / Android Native Apps & React Web SPA         │
    │   └── Transmits HTTPS / TLS 1.3 Requests to Edge Gateway (65,000 req/s)     │
    └──────────────────────────────────────┬──────────────────────────────────────┘
                                           │
                             ▼ (Edge Reverse-Proxy Seam)
    ┌─────────────────────────────────────────────────────────────────────────────┐
    │ Container 1: Ingress API Gateway Container (Envoy / Go)                    │
    │   ├── Terminates TLS, Validates OAuth 2.1 JWT Tokens, Throttles Rate Limits │
    │   └── Routes Requests over Internal mTLS Mesh via High-Speed gRPC           │
    └──────────────────────────────────────┬──────────────────────────────────────┘
                                           │
             ┌─────────────────────────────┼─────────────────────────────┐
             ▼ (Synchronous gRPC: < 15ms)  ▼ (Synchronous gRPC: < 12ms)  ▼ (Async Event Ingestion)
    [ Container 2: Core Banking ]   [ Container 3: Auth Gateway ]  [ Container 4: Outbox Relay ]
      ├── Aurora PostgreSQL (ACID)    ├── Redis Cluster (Sessions)   ├── Streams to Apache Kafka
      └── Pinned High-Priority Pool   └── Keycloak Identity Core     └── Zero In-Container Coupling
                                                                         │
                                                                         ▼ (Decoupled Background)
                                                           [ Container 5: Statement Worker ]
                                                             ├── S3 Object Storage
                                                             └── CNT-4919 Crash ELIMINATED
    

    Criteria and weights

    CriterionWhy it matters hereWeightSource of the weight
    Container Blast-Radius Isolation & StabilityMonolithic coupling crashed core banking in CNT-4919 ($3.8M penalty).0.40David O'Reilly (Chief Enterprise Architect)
    C4 Level 2 Container Boundary PrecisionContainer responsibilities, protocols, and datastores must be unambiguous.0.30Elena Rostova (Head of Retail Banking Platforms)
    Transactional Latency Performance (p99 <= 45 ms)Inter-container network hops must not breach the 45ms end-to-end payment budget.0.15Core Payment Network Operations Charter
    Datastore Exclusivity (Zero Cross-DB Access)Containers must access databases exclusively via owning service domain APIs.0.15Database Architecture & Governance Guild

    Comparison

    Container Topology CandidateFailure Blast RadiusScaling ElasticityNetwork Protocol OverheadEvaluation
    Option A: Monolithic Multi-Threaded ContainerZero (Systemic crash in CNT-4919)Monolithic (All or nothing)None (In-process memory calls)Rejected: Caused CNT-4919 disaster; unviable.
    Option B: 50+ Micro-Containers (Extreme Mesh)Very HighHighHigh (Network latency tax on 15 hops)Rejected: Exceeds 45ms budget; high operational drag.
    Option C: Bounded 6-Container C4 Mesh (Chosen)Isolated (Dedicated Pod Pools)Independent Auto-ScalingMinimal (High-Speed gRPC / mTLS)Selected: Sub-45ms latency, zero blast bleed, proven.

    Result

    Option C is selected. The system is decomposed into 6 cohesive C4 Containers; the Core Banking Container is isolated from background Statement Generation; communication enforces gRPC with Protobuf; databases maintain single-container ownership.


    Required Mechanisms

    1. C4 Level 2 Container Diagram Specification [MC-CD-01]
    C4Container
        title Container Diagram for Omnichannel Retail Banking [C4CONT-BANK-001]
    
        Person(customer, "Retail Banking Customer", "Personal banking customer accessing accounts and payments")
    
        Container_Boundary(c1, "Omnichannel Retail Banking System") {
            Container(spa, "Web SPA Application", "TypeScript / React", "Provides responsive customer self-service banking in web browsers")
            Container(mobile, "Mobile Banking App", "Kotlin Multiplatform / Swift", "Provides native mobile banking and biometric payments on iOS/Android")
            Container(gateway, "Ingress API Gateway Container", "Envoy / Go", "Terminates mTLS, validates JWT tokens, routes traffic, enforces rate limits")
            Container(core, "Core Banking Ledger Container", "Java 21 / Spring Boot", "Manages account balances, ledger postings, and transaction processing")
            Container(statement, "Statement Generation Worker", "Go Worker", "Asynchronously generates PDF statements and monthly financial tax reports")
            Container(notification, "Notification Dispatcher", "Node.js / TypeScript", "Dispatches customer SMS and email transaction alerts asynchronously")
    
            ContainerDb(aurora, "Aurora PostgreSQL 16", "Relational RDBMS", "Stores accounts, ledger entries, and outbox event tables (ACID)")
            ContainerDb(redis, "Redis Cluster 7", "In-Memory Datastore", "Stores active user sessions, token caches, and rate-limiting buckets")
            ContainerQueue(kafka, "Apache Kafka 3.6", "Event Streaming Fabric", "Topic: banking.transactions.v1 (Partitioned by account_id)")
            ContainerDb(s3, "Amazon S3 Vault", "Object Storage", "Stores immutable PDF statements and regulatory tax document archives")
        }
    
        Rel(customer, spa, "Visits banking portal", "HTTPS / TLS 1.3")
        Rel(customer, mobile, "Executes biometric payments", "HTTPS / TLS 1.3")
        Rel(spa, gateway, "Submits API requests", "JSON / HTTPS")
        Rel(mobile, gateway, "Submits mobile API requests", "JSON / HTTPS")
    
        Rel(gateway, core, "Routes transaction calls", "gRPC / Protobuf (mTLS)")
        Rel(gateway, redis, "Validates session tokens", "Redis Binary Protocol")
        Rel(core, aurora, "Executes ACID balance commits", "PostgreSQL Wire Protocol")
        Rel(core, kafka, "Publishes transaction events", "Kafka TCP Protocol")
    
        Rel(kafka, statement, "Consumes transaction stream", "Kafka Consumer Protocol")
        Rel(statement, s3, "Archives generated PDF statements", "AWS S3 REST API")
        Rel(kafka, notification, "Consumes alert events", "Kafka Consumer Protocol")
    
    2. The CNT-4919 Resource Contention Remediation [MC-RC-01]
    • Root Cause Elimination:
      • In incident CNT-4919, PDF generation libraries allocated large raster memory buffers inside the core banking container, triggering JVM Out-Of-Memory kernel kills.
      • Container Isolation Contract:
        • Statement Generation Worker is physically decoupled into an independent Kubernetes deployment on separate worker nodes.
        • Consumes asynchronously from Apache Kafka; even if statement workers experience 100% memory saturation, Core Banking Ledger Container operates with zero memory interference.
    3. Inter-Container Protocol & Security Seams [MC-PS-01]
    • Synchronous Ingress Path:
      • Gateway to Core Banking routes via gRPC over mTLS with HTTP/2 multiplexing.
      • Protocol Buffers binary serialization delivers sub-millisecond serialization latency ($< 0.4\text{ ms}$).
    • Asynchronous Side-Effect Path:
      • All non-blocking operations (statements, notifications, analytics) execute asynchronously via

    Apache Kafka event consumers.


    Invariants and Contracts

    Mandatory Container Single-Responsibility Invariant [INV-C4CONT-01]
      Core real-time transaction processing and asynchronous background batch workers must execute in separate containers.
      Packaging heavy document generation or analytical batch routines inside transactional containers is strictly prohibited.
    
    Exclusive Database Container Ownership [INV-C4CONT-02]
      Relational database clusters must be owned and accessed directly by exactly one container domain.
      Direct cross-container SQL connections or database sharing between distinct microservice containers is barred.
    
    Mandatory Internal mTLS Encryption [INV-C4CONT-03]
      All inter-container network communication within the Kubernetes cluster must enforce mutual TLS (mTLS).
      Transmitting unencrypted HTTP or unauthenticated gRPC traffic across container boundaries is prohibited.
    

    Explicit Unknowns

    • CPU utilization overhead of Envoy sidecar mTLS encryption during peak 65,000 requests/second traffic surges (G-1).
    • Time required for Amazon S3 PDF statement uploads to complete during end-of-month commercial account billing runs (G-2).

    Traceability

    ClaimClassificationSourceFreshness
    24 million customers across web/mobile/branchprovidedDigital banking platform briefCurrent
    65,000 requests/sec peak volumeprovidedIngress volumetric traffic intakeCurrent
    Incident CNT-4919 $3.8M penalty and container OOMprovidedOperations forensic audit reportHistorical
    p99 latency target <= 45 ms and C4 Level 2 standardsprovidedCorporate Architecture Documentation GuildCurrent
    Bounded 6-Container C4 Mesh (Option C) selecteddecidedDavid O'Reilly & Elena Rostova2026-09-15
    Mandatory container single-responsibility invariantdecidedArchitectural invariant INV-C4CONT-012026-09-15

    Verification

    No validator was supplied, so no command was run.

    Reviewer self-check against C4 container diagram standards:

    • Isolation Rigor: PASS. Statement worker separated from core ledger (CNT-4919 closed).
    • Protocol Precision: PASS. Explicit gRPC/mTLS, HTTPS, and Kafka wire protocols modeled.
    • Datastore Exclusivity: PASS. Aurora owned by Core; Redis owned by Gateway; S3 owned by Statement.
    • Markdown Hygiene: PASS. Native Markdown syntax strictly adheres to rule_markdown.md.

    Open Decisions

    • DEC-C4CONT-01: David O'Reilly to determine whether Istio Service Mesh or AWS App Mesh should be standardized for inter-container mTLS key rotation in Q1 (Owner: David O'Reilly).

    Next steps

    1. Ingress Platform squad deploys the Envoy Ingress Gateway container on AWS EKS.
    2. Core Banking team migrates inter-service REST endpoints to gRPC with Protocol Buffers.
    3. Conduct staging stress test firing 65,000 requests/sec while triggering 50,000 PDF statements to confirm zero core degradation.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    What it does

    This skill projects an authoritative software-system/container model into C4 level-2 semantics. It preserves system boundaries, container identities, responsibilities, technologies only when sourced, interfaces, relations, people/external systems, provenance and notation loss.

    Use it when

    Use when consumers need a reproducible C4 container view of an already accepted software-system model at an explicit revision and viewpoint.

    For example: “Our telemedicine platform diagram shows twelve microservices, but three of them are actually libraries inside one process and two share a database that isn't drawn.”

    What you get

    • C4 Container Diagram (Mermaid/PlantUML)

    Written as Markdown to <your output folder>/architecture/tasks/<run-id>/container-diagram/.

    What it will not do

    Do not use for C4 context/component/code views, system/container design, deployment diagrams, Docker/Kubernetes/cloud modeling, technology selection, code extraction, API design, architecture review or implementation.

    How it works

    1. Check the level is inside one system.
    2. Define a container as something that runs or stores.
    3. Give each container its responsibility and its technology.
    4. Draw the relationships with protocol and purpose.
    5. Render only accepted containers.
    6. 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-task.md
    • references/domain-rules.md
    • references/operating-rules.md
    • references/output-contract.md

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Technical Documentation.

    Do not use for C4 context/component/code views, system/container design, deployment diagrams, Docker/Kubernetes/cloud modeling, technology selection, code extraction, API design, architecture review or implementation.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scan

    Security scan passed 1 month ago

    Permissions

    Read Files
    Write Files

    Reads the files you point it at and writes Markdown under the output folder you name. No network access, no environment variables, and no bundled scripts.

    Listed1 month ago

    What's inside

    Frequently Asked Questions

    No. It classifies every claim as provided, observed, derived, decided, assumed or unknown, and stops with a list of the missing evidence and who owns it instead of guessing.

    No. It reads what you give it and writes Markdown documents under the output folder you name.

    Any agent that supports SKILL.md skills, including Claude Code, Codex CLI, Cursor and Gemini CLI. It has no scripts and makes no network calls.

    Unzip it into your agent's skills folder, for example: unzip container-diagram.zip -d ~/.claude/skills/

    New in Technical Documentation