C4 model
The C4 model is a framework for visualizing software architecture at different levels of abstraction.
The model consists of four levels:
-
Context: Shows how your system fits into the world, including external users and systems it interacts with.
-
Container: Depicts the high-level technology choices, showing applications, databases, and services that make up the system. A container does not necessarily map to a Docker container or virtual machine, but rather represents an independently deployable or executable unit.
-
Component: Zooms into individual containers to show their internal structure and key components.
-
Code: Shows how individual components are implemented.
The "code" level is optional, and often auto-generated from actual code.
The C4 model was created by Simon Brown. Google Maps served as inspiration. Just as Google Maps allows users to zoom in and out to see different levels of detail, the C4 model provides a way to zoom in and out of software architecture models, each operating at a different level of abstraction or granularity.
The model’s visual notation emphasizes simplicity, using basic boxes and lines, making the diagrams accessible to both technical and non-technical stakeholders.
C4 modeling tools
See also Modeling for more modeling tools.
-
Structurizr — Developed by Simon Brown, who also created the C4 model, Structurizr is an online diagrams-as-code tool that generates C4 models from a plain-text language, the Structurizr DSL, which is a modeling language in its own right.
-
IcePanel (docs) — Features include interactive diagrams that are zoomable into increasing levels of technical detail. Freemium SaaS. You create models of the first three levels of the C4 model – context, container, component – and then at the bottom you can link to code in GitHub or other repositories.