C4 model
The C4 model is a lean graphical notation technique for modeling the architecture of software systems. It is based on a structural decomposition of a system into containers and components and relies on existing modelling techniques such as Unified Modeling Language or entity–relationship diagrams for the more detailed decomposition of the architectural building blocks.
History
The C4 model was created by the software architect Simon Brown between 2006 and 2011 on the roots of Unified Modelling Language and the 4+1 architectural view model. The launch of an official website under a Creative Commons license and an article published in 2018 popularised the emerging technique.Overview
The C4 model documents the architecture of a software system, by showing multiple points of view that explain the decomposition of a system into containers and components, the relationship between these elements, and, where appropriate, the relation with its users.The viewpoints are organized according to their hierarchical level:
- Context diagrams : show the system in scope and its relationship with users and other systems;
- Container diagrams : decompose a system into interrelated containers. A container represents an application or a data store;
- Component diagrams : decompose containers into interrelated components, and relate the components to other containers or other systems;
- Code diagrams : provide additional details about the design of the architectural elements that can be mapped to code. The C4 model relies at this level on existing notations such as Unified Modelling Language, Entity Relation Diagrams or diagrams generated by Integrated Development Environments.
The C4 model facilitates collaborative visual architecting and evolutionary architecture in the context of agile teams where more formal documentation methods and up-front architectural design are not desired.
Tools
- : Collaborative diagramming and modelling tool with drag-and-drop UI.
- : Structurizr builds upon "diagrams as code", allowing you to create multiple software architecture diagrams from a single model.
- PlantUML: C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicating software architectures.
- : Architecture as Code framework that allows you to model Architecture in code once and then generates diagrams of any Scope, Level of Details and Types.