L2 Container Diagram Example
The L2 Container diagram zooms into a system and reveals its domain structure, integration services, databases, and message queues — including the technology choices and communication protocols.
See Example C4 Diagrams for an overview of all diagram types and when to use each.
To use this example in Nodinite, copy the Mermaid markup below and follow the Creating Your First C4 Diagram import walkthrough to create a Diagram Set, import the markup, and bind nodes to your Repository. Container nodes bind to either Services or Systems — use the import wizard to choose the correct entity type for each node.
When to Use
- Planning or reviewing a system's internal architecture
- Communicating technology choices to technical teams
- Identifying integration points and data flows between domains
- Does not show code-level detail — that belongs in L3
Example: O2C Four-Domain Container View
This example uses the Order-to-Cash (O2C) demo data and reveals the four domain boundaries (Sales, Planning, Logistics, Finance) with their integration services. Beyond the standard O2C services, the diagram adds external container variants (Container_Ext, ContainerDb_Ext, ContainerQueue_Ext) and an Enterprise_Boundary to exercise all shape types available at L2. The BiRel connector between ERP and the external EDI gateway demonstrates bidirectional document exchange.
| Preview | Mermaid Code |
|---|---|
|
C4Container
title Order-to-Cash (O2C) — L2 Container Diagram
Person(customer, "Customer", "Places orders and receives confirmations")
Person_Ext(finance_officer, "Finance Officer", "Reviews invoices in ERP-Finance")
Person_Ext(auditor, "External Auditor", "Reviews financial compliance records")
Enterprise_Boundary(o2c_enterprise, "Nodinite O2C Enterprise") {
Boundary(sales, "Sales", "Domain") {
Container(portal, "Portal", "Customer Web App", "Receives orders and delivers confirmations to customers")
Container(rcv_order, "INT1337-RCV-Order-Incoming", "Integration / JSON", "Receives inbound order from Portal. Step 0 — Milestone: Order Received from Customer")
Container(snd_confirm, "INT1337-SND-Confirm-Outgoing", "Integration / CSV", "Sends order confirmation back to customer. Step 2 — Milestone: Order Confirmation Delivered")
ContainerDb(order_store, "Order Store", "SQL Server", "Persists inbound order records for deduplication and retry")
}
Boundary(planning, "Planning", "Domain") {
Container(erp, "ERP", "Enterprise Resource Planning", "Order entry, inventory management, and production scheduling")
Container(ent_order, "INT1337-ENT-Order-Entry", "Integration / XML", "Creates order entry record in ERP. Step 1 — Milestone: Order Entry in ERP Finished")
Container(pln_scheduled, "INT1337-PLN-Order-Scheduled", "Integration / JSON", "Publishes production schedule confirmation. Step 3 — Milestone: Production Scheduled")
ContainerQueue(planning_bus, "Planning Event Bus", "Azure Service Bus", "Async event queue for production schedule notifications")
}
Boundary(logistics, "Logistics", "Domain") {
Container(wms, "WMS", "Warehouse Management System", "Warehouse packing and delivery operations")
Container(pkg_packed, "INT1337-PKG-Order-Packed", "Integration / XML", "Confirms order is packed and ready for transport. Step 4 — Milestone: Order Completed for Transport")
Container(dlv_delivered, "INT1337-RCV-Order-Delivered", "Integration / PSV", "Records final delivery confirmation. Step 5 — Milestone: Order Delivered")
}
Boundary(finance, "Finance", "Domain") {
Container(erp_finance, "ERP-Finance", "Finance Module", "Invoice generation and revenue recognition")
Container(inv_invoiced, "INT1337-INV-Order-Invoiced", "Integration / JSON", "Issues final invoice upon delivery. Step 6 — Milestone: Order Invoiced")
}
}
Container_Ext(payment_gateway, "Payment Gateway", "External REST API", "Processes customer credit card payments")
ContainerDb_Ext(carrier_tracking, "Carrier Tracking DB", "External Database", "Provides real-time parcel tracking and delivery confirmation data")
ContainerQueue_Ext(edi_gateway, "EDI Gateway", "External Message Queue", "B2B queue for trading partner order and invoice document exchange")
Rel(customer, portal, "Places order", "HTTPS / JSON")
Rel(portal, rcv_order, "Drops order file", "JSON / O2C.Order.Received/1.0")
Rel(rcv_order, order_store, "Persists order for processing", "SQL")
Rel(rcv_order, ent_order, "Forwards to ERP", "XML / O2C.Order.Entry/1.0")
Rel(ent_order, erp, "Enters order record", "ERP API")
Rel(ent_order, snd_confirm, "Triggers confirmation", "CSV")
Rel(snd_confirm, portal, "Delivers confirmation", "CSV / O2C.Order.Confirmation/1.0")
Rel(erp, planning_bus, "Publishes schedule event", "AMQP")
Rel(planning_bus, pln_scheduled, "Delivers schedule event", "AMQP")
Rel(pln_scheduled, pkg_packed, "Triggers packing", "XML / O2C.Order.Ready/1.0")
Rel(pkg_packed, wms, "Updates WMS state", "WMS API")
Rel(wms, dlv_delivered, "Confirms delivery", "PSV / O2C.Order.Delivered/1.0")
Rel(dlv_delivered, inv_invoiced, "Triggers invoicing", "JSON")
Rel(inv_invoiced, erp_finance, "Creates invoice", "JSON / O2C.Order.Invoice/1.0")
Rel(finance_officer, erp_finance, "Reviews invoices", "Web")
Rel(portal, payment_gateway, "Processes payment at order placement", "REST / HTTPS")
Rel(wms, carrier_tracking, "Reads delivery confirmation", "REST API")
BiRel(erp_finance, edi_gateway, "Exchanges invoice and order documents", "AS2")
Rel(auditor, carrier_tracking, "Audits delivery records", "REST API")
|
|
Shape Coverage
This example exercises the following L2 shape vocabulary from the toolbox plan:
| Shape used | Macro | Notes |
|---|---|---|
| Person (internal) | Person |
Customer |
| Person (external) | Person_Ext |
Finance Officer, External Auditor |
| Container (generic) | Container |
Portal, ERP, WMS, ERP-Finance, integration services |
| Container Database | ContainerDb |
Order Store (SQL Server) |
| Container Queue | ContainerQueue |
Planning Event Bus (Azure Service Bus) |
| Container (external) | Container_Ext |
Payment Gateway |
| Container Database (external) | ContainerDb_Ext |
Carrier Tracking DB |
| Container Queue (external) | ContainerQueue_Ext |
EDI Gateway |
| Generic boundary | Boundary |
Four O2C domain boundaries |
| Enterprise boundary | Enterprise_Boundary |
Wraps all O2C domains |
| Bidirectional connector | BiRel |
ERP-Finance ↔ EDI Gateway document exchange |
Next Step
Zoom into the Sales domain with the L3: Component Diagram Example to see its internal integration components.
Related Topics
- Example C4 Diagrams — Overview of all diagram types
- L1: Context Diagram Example — Zoomed-out system view of the Portal
- L3: Component Diagram Example — Internals of the Sales domain
- What is C4 Diagrams?
L2 Container Diagram Example
The L2 Container diagram zooms into a single system and reveals its internal applications, services, databases, and message buses — including the technology choices and communication protocols.
See Example C4 Diagrams for an overview of all diagram types and when to use each.
To use this example in Nodinite, copy the Mermaid markup below and follow the Creating Your First C4 Diagram import walkthrough to create a Diagram Set, import the markup, and bind nodes to your Repository. Container nodes can bind to either Services or Systems — use the import wizard to choose the correct entity type for each node.
When to Use
- Planning or reviewing a system's internal architecture
- Communicating technology choices to technical teams
- Identifying integration points and data flows between containers
- Does not show code-level detail — that belongs in L3
Example: Order Management System Internal Structure
| Preview | Mermaid Code |
|---|---|
|
C4Container
title Order Management System - L2 Container Diagram
Person(customer, "Customer", "Places orders via web or mobile")
Boundary(order_system, "Order Management System") {
Container(web_app, "Web Application", "React.js", "Displays orders and order history. Allows customers to place and track orders.")
Container(mobile_app, "Mobile App", "React Native", "Allows customers to place orders on their phone")
Container(admin_portal, "Admin Portal", "ASP.NET Core", "Internal tool for support agents to manage orders and refunds")
Container(order_api, "Order API", "ASP.NET Core REST", "Provides order management capabilities to web, mobile, and admin applications")
Container(fulfillment_svc, "Fulfillment Service", "Node.js", "Coordinates order fulfillment with warehouse ERP")
ContainerDb(order_db, "Order Database", "SQL Server", "Stores customers, orders, and line items")
ContainerDb(inventory_cache, "Inventory Cache", "Redis", "Caches current inventory levels")
ContainerQueue(message_bus, "Message Bus", "Azure Service Bus", "Asynchronous event processing for order fulfillment")
}
System_Ext(payment_gateway, "Payment Gateway", "Processes payments")
System_Ext(email_service, "Email Service", "Sends notifications")
System_Ext(warehouse_erp, "Warehouse ERP", "Manages physical inventory")
Rel(customer, web_app, "Uses", "HTTPS")
Rel(customer, mobile_app, "Uses", "HTTPS")
Rel(web_app, order_api, "Calls", "REST/JSON")
Rel(mobile_app, order_api, "Calls", "REST/JSON")
Rel(admin_portal, order_api, "Calls", "REST/JSON")
Rel(order_api, order_db, "Reads/Writes", "SQL")
Rel(order_api, inventory_cache, "Reads", "Redis Protocol")
Rel(order_api, message_bus, "Publishes Order Placed event", "AMQP")
Rel(fulfillment_svc, message_bus, "Subscribes to events", "AMQP")
Rel(fulfillment_svc, warehouse_erp, "Sends fulfillment requests", "REST/JSON")
Rel(order_api, payment_gateway, "Processes payment", "REST/JSON")
Rel(order_api, email_service, "Sends notifications", "SMTP")
|
|
Test Data Setup
To recreate this diagram in Nodinite, create the following entities.
Domains (boundaries):
- Experience APIs
- Process APIs
- System APIs
Services in Experience APIs:
- Web Application (C4ContainerType: WebApp, C4Technology: React.js)
- Mobile App (C4ContainerType: MobileApp, C4Technology: React Native)
- Admin Portal (C4ContainerType: WebApp, C4Technology: ASP.NET Core)
Services in Process APIs:
- Order API (C4ContainerType: RestApi, C4Technology: ASP.NET Core REST)
- Fulfillment Service (C4ContainerType: Service, C4Technology: Node.js)
Services in System APIs:
- Order Database (C4ContainerType: Database, C4Technology: SQL Server)
- Inventory Cache (C4ContainerType: Cache, C4Technology: Redis)
- Message Bus (C4ContainerType: MessageBus, C4Technology: Azure Service Bus)
Next Step
Zoom further into the Order API with the L3: Component Diagram Example to see its internal modules.
Related Topics
- Example C4 Diagrams — Overview of all diagram types
- L1: Context Diagram Example — Zoomed-out system view
- L3: Component Diagram Example — Internals of a single container
- What is C4 Diagrams?