Abstractions of the C4 model: A software system is made up of one or more containers (web applications, databases, etc), each of which contains one or more components, which in turn are implemented by one or more code elements (classes, interfaces, objects, functions, etc)
The C4 model is a lean graphical notation technique for modeling the architecture of software systems. It is based on a structural decomposition (a hierarchical tree structure) of a system into containers and components and relies on existing modelling techniques such as Unified Modeling Language (UML) or entity–relationship diagrams (ERDs) for the more detailed decomposition of the architectural building blocks.
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 (level 1): show the system in scope and its relationship with users and other systems;
Container diagrams (level 2): decompose a system into interrelated containers. A container represents an application or a data store;
Component diagrams (level 3): decompose containers into interrelated components, and relate the components to other containers or other systems;
For level 1 to 3, the C4 model uses 5 basic diagramming elements: persons, software systems, containers, components and relationships. The technique is not prescriptive for the layout, shape, colour and style of these elements. Instead, the C4 model recommends using simple diagrams based on nested boxes in order to facilitate interactive collaborative drawing. The technique also promotes good modelling practices such as providing a title and legend on every diagram, and clear unambiguous labelling in order to facilitate the understanding by the intended audience.
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
IcePanel: Collaborative diagramming and modelling tool with drag-and-drop UI.
Viaduct: Viaduct helps software teams create, maintain, and share C4 architecture models and documentation for their systems.
Structurizr: 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.
C4InterFlow: Architecture as Code (AaC) framework that allows you to model Architecture in code once (e.g. YAML, JSON etc.) and then generates diagrams of any Scope, Level of Details (e.g. Context, Container and Component) and Types (e.g. C4, C4 Static (dependencies) and Sequence).
12Richards, Mark; Ford, Neal (2019). Fundamentals of software architecture: an engineering approach. O'REILLY MEDIA. p.293. ISBN978-1-4920-4342-3. OCLC1138515057. some standard are emerging for diagramming software architecture (such as software architect Simon Brown's C4 model or The Open Group Archimate standard)
12Enríquez, René (2018). Software Architecture with Spring 5. 0: Design and Architect Highly Scalable, Robust, and High-Performance Java Applications. Salazar, Alberto. Packt Publishing Ltd. pp.41–44. ISBN978-1-78899-673-0. OCLC1053798657.