C4 software architecture model
Core concepts and definitions
C4 is Simon Brown's software architecture model. A software system contains containers, containers contain components, and code elements implement components.
| Level |
Definition |
| Context |
One software system, its direct users, and external collaborators. |
| Container |
An application or data store within a system, forming a runtime boundary for code execution or data storage. |
| Component |
A unit of functionality with an explicit interface inside one container, typically deployed with that container. |
| Code |
The classes, interfaces, functions, or data structures implementing one component. |
A person represents a role interacting with the system. An external system is outside the current system boundary and may belong to the same organization.
A system landscape describes relationships across systems. A dynamic view describes interaction order within a scenario. A deployment view maps container instances to infrastructure in a particular environment. These are supporting views.
Principles
Based on the C4 website and its diagram definitions.
- Use hierarchical abstractions and expand through system, container, component, and code containment.
- Choose levels for the audience. There is no requirement to use all four.
- Keep the model independent of notation.
- Keep the model independent of tooling.
Avoiding mistakes
- A C4 container is distinct from a Docker container, virtual machine, source folder, or library.
- Identify components by responsibility and interface, rather than folder or class names alone.
- Code is level four. Deployment and dynamic diagrams do not replace it.
- Multiple deployed instances of one logical container still map to one container.
- Distinguish runtime calls, source dependencies, and data flows.
- Separate current state, target design, and inference. Leave unsupported structures and relationships unconfirmed.
1---2name: architect-4c3description: Use only when explicitly invoked. Core concepts, level definitions, principles, and common mistakes in Simon Brown's C4 model.4metadata:5 source: https://skillmd.com/skills/ontology-of-everything/architect-4c6 language: en7 translation_of: architect-4c-cn8 version: "0.1.0"9 openclaw:10 homepage: https://github.com/ontology-of-everything/concept-skills/tree/main/skills/en/architect-4c11---1213# C4 software architecture model1415## Core concepts and definitions1617C4 is Simon Brown's software architecture model. A software system contains containers, containers contain components, and code elements implement components.1819| Level | Definition |20|---|---|21| Context | One software system, its direct users, and external collaborators. |22| Container | An application or data store within a system, forming a runtime boundary for code execution or data storage. |23| Component | A unit of functionality with an explicit interface inside one container, typically deployed with that container. |24| Code | The classes, interfaces, functions, or data structures implementing one component. |2526A person represents a role interacting with the system. An external system is outside the current system boundary and may belong to the same organization.2728A system landscape describes relationships across systems. A dynamic view describes interaction order within a scenario. A deployment view maps container instances to infrastructure in a particular environment. These are supporting views.2930## Principles3132Based on the [C4 website](https://c4model.com/) and its [diagram definitions](https://c4model.com/diagrams).3334- Use hierarchical abstractions and expand through system, container, component, and code containment.35- Choose levels for the audience. There is no requirement to use all four.36- Keep the model independent of notation.37- Keep the model independent of tooling.3839## Avoiding mistakes4041- A C4 container is distinct from a Docker container, virtual machine, source folder, or library.42- Identify components by responsibility and interface, rather than folder or class names alone.43- Code is level four. Deployment and dynamic diagrams do not replace it.44- Multiple deployed instances of one logical container still map to one container.45- Distinguish runtime calls, source dependencies, and data flows.46- Separate current state, target design, and inference. Leave unsupported structures and relationships unconfirmed.