- 3 minutes to read
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.
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 (swimlanes):
- 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?