The idea of the C4 model is to show architecture as maps at different zoom levels, as in geography: from a “bird’s-eye view” down to a single class. Readers choose their own depth: the context diagram is enough for management, while developers need containers and components. The model is named after four levels whose English names start with C: context, containers, components, code.
Four levels
| Level | What it shows |
|---|---|
| Context | the system as a single box in the centre, surrounded by users and external systems; no technologies or protocols, so the diagram can be shown to non-technical readers |
| Containers | applications and data stores inside the system: a web application, a mobile application, a database; who is responsible for what, which technologies are chosen, how the containers communicate |
| Components | parts inside a single container with their responsibilities and technologies; drawn only when the diagram is genuinely needed |
| Code | how a component is structured in code: a UML class diagram or an entity diagram; an optional level, usually generated by the development environment |
A container here is not a Docker container but any application or data store: a server-side application, a single-page interface, a mobile application, a database, a bucket in object storage. Supplementary diagrams sit alongside the four levels: a dynamic diagram shows how elements interact in a single scenario, a deployment diagram shows on which servers and in which environments the instances run, and a landscape diagram shows how several systems of an organisation are connected.
How it is applied
- a new team, a customer or a talk audience is introduced to the system with the context diagram, then the containers diagram — these are usually drawn first
- the model shows the static structure of the system; it does not cover business processes, workflows, data models or states — these are supplemented with other diagrams
- a large diagram is split into several simple ones, each telling its own part of the story at a single level of detail
- the notation is free: the model is tied to neither a notation nor a tool; strict notations such as UML are added alongside when they are needed
The model was proposed by Simon Brown: the roots of the approach go back to 2006–2009, the level names settled by 2010, and the name “C4” was first used in 2011. The author maintains a description of the model, diagram rules and examples on a separate site, freely available.
Sources
the term is written from these pagesVerified 8 Nov