C4 Template
The C4 model, introduced by Simon Brown, is a visual modeling approach used in software development to represent the architecture of a software system. C4 stands for Context, Containers, Components, and Code. The model uses a hierarchical structure to describe a system at different levels of detail, making it easier for stakeholders to understand the system’s architecture and design.
Level | Description |
---|---|
Context | The highest level of the model, providing a big-picture view of the system, its scope, and its interactions with external entities (e.g., users, other systems). The context diagram helps stakeholders understand the system’s purpose and its relationship with the surrounding environment. |
Containers | This level zooms in to depict the building blocks of the system, such as applications, data stores, or microservices. Containers represent the main runtime elements that are responsible for specific functionality within the system. The container diagram helps developers and architects understand the system’s high-level technology choices and their interactions. |
Components | At this level, the model focuses on the internal structure of each container, showing the main components responsible for specific functionality and their interactions. The component diagram helps developers understand the organization of the codebase and the main responsibilities of each component. |
Code | The lowest level of the C4 model, illustrating the detailed implementation of a specific component. This level typically includes class diagrams, source code, or other low-level design artifacts. The code level helps developers understand the specifics of the component’s implementation and guides them through the coding process. |