Blog5 min read

C4 Model Examples - Real-World Architecture Diagrams

By Visual C4 Team

C4 Model Examples: Real-World Architecture Diagrams

See how the C4 model works in practice with these real-world examples across different architectural patterns.

E-commerce Platform (Microservices)

Context Diagram

C4Context
    title E-commerce Platform Context
    UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2")

    Person(customer, "Customer", "Online shoppers")
    System(ecommerce, "E-commerce System", "Online shopping platform")
    System_Ext(payment, "Payment Gateway", "External payment processing")
    System_Ext(inventory, "Inventory System", "Product inventory management")
    System_Ext(shipping, "Shipping Service", "Order fulfillment and delivery")

    Rel(customer, ecommerce, "Shops using")
    Rel(ecommerce, payment, "Processes payments via")
    Rel(ecommerce, inventory, "Manages inventory with")
    Rel(inventory, shipping, "Triggers shipping via")

Container Diagram

  • Web App: React frontend
  • API Gateway: Kong/Nginx
  • Order Service: Node.js microservice
  • Payment Service: Java Spring Boot
  • Database: PostgreSQL cluster

Banking System (Monolith)

Context View

Banking System Context Diagram

This real banking system context diagram demonstrates:

  • Personal Banking Customer - Primary system user
  • Internet Banking System - Core banking application
  • Mainframe Banking System - Legacy core banking backend
  • E-mail System - Customer notification service

Key aspects of this banking system:

  • Core banking system
  • ATM network integration
  • Regulatory reporting
  • Customer mobile apps

Container Breakdown

  • Core Application: Java monolith
  • Database: Oracle RAC
  • Message Queue: IBM MQ
  • Web Portal: JSF frontend

SaaS Analytics Platform

System Context

C4Context
    title SaaS Analytics Platform Context
    UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="2")

    System_Ext(datasources, "Data Sources", "External data feeds and APIs")
    System(analytics, "Analytics Platform", "SaaS data processing and visualization")
    Person(dashboardUsers, "Dashboard Users", "Business analysts and managers")
    Person(apiConsumers, "API Consumers", "Third-party integrations")
    Person(adminUsers, "Admin Users", "Platform administrators")

    Rel(datasources, analytics, "Feeds data to")
    Rel(analytics, dashboardUsers, "Provides dashboards to")
    Rel(analytics, apiConsumers, "Serves data via API to")
    Rel(adminUsers, analytics, "Manages and configures")

Container Architecture

Container Level Diagram Example

The container architecture shows:

  • Data Ingestion: Apache Kafka
  • Processing Engine: Apache Spark
  • Storage Layer: ClickHouse
  • API Layer: FastAPI
  • Frontend: Vue.js dashboard

Cloud-Native Startup

Context Diagram

Modern startup with cloud-first approach:

  • Users: Web and mobile
  • External APIs: Stripe, SendGrid
  • Infrastructure: AWS managed services

Container Structure

  • Frontend: Next.js on Vercel
  • Backend: Serverless functions
  • Database: Amazon RDS
  • Cache: Redis ElastiCache
  • Storage: S3 buckets

Enterprise Legacy Migration

Shows migration from monolith to microservices:

Before (Context)

C4Context
    title Legacy System Context
    UpdateLayoutConfig($c4ShapeInRow="2", $c4BoundaryInRow="1")

    Person(users, "Users", "Enterprise employees")
    System(legacy, "Legacy System", "Monolithic enterprise application")
    System_Ext(mainframe, "Mainframe", "Core business data processing")

    Rel(users, legacy, "Uses")
    Rel(legacy, mainframe, "Integrates with")

After (Container View)

  • API Gateway: Routes traffic
  • User Service: Handles authentication
  • Product Service: Catalog management
  • Legacy Adapter: Mainframe integration

Key Patterns in Examples

Common Context Elements

  • External users and systems
  • Third-party integrations
  • Regulatory requirements

Container Patterns

  • Frontend/Backend separation
  • Database per service
  • API Gateway pattern
  • Event-driven communication

Component Examples

  • Controllers: Handle HTTP requests
  • Services: Business logic
  • Repositories: Data access
  • Events: Async communication

Templates for Your Projects

Startup Template

  1. Context: Users → System → External APIs
  2. Containers: Frontend, API, Database
  3. Components: Auth, Business Logic, Data

Enterprise Template

  1. Context: Multiple user types, legacy systems
  2. Containers: API Gateway, microservices, databases
  3. Components: Domain services, shared libraries

Migration Template

  1. Current State: Existing system context
  2. Target State: Desired architecture
  3. Migration Path: Step-by-step transition

Tools Used in Examples

C4 Builder Interface

All examples were created using our Visual C4 tool, which provides:

  • Visual C4: Created all diagrams shown above
  • PlantUML: Text-based alternatives
  • Structurizr: Architecture tooling

The interface shows drag-and-drop components, real-time collaboration, and export capabilities for creating professional C4 diagrams.

Advanced Implementation Topics

To successfully implement these patterns in your organization:

Next Steps

Apply these patterns to your architecture:

Ready to create your own? Start with our free tool and adapt these examples to your needs.

C4 Model Examples - Real-World Architecture Diagrams