The C4 Model for Software Architecture
The C4 model is a lean, developer-friendly approach to visualizing software architecture. Created by Simon Brown, it consists of a set of hierarchical diagrams that describe a software system at different levels of abstraction, each tailored to a specific audience.
The name "C4" refers to the four core diagram types: Context, Containers, Components, and Code.
The central idea is to create a map of your software. You can zoom in and out to get different levels of detail, telling a cohesive story about your system's architecture to various audiences, from non-technical stakeholders to software developers.
The Levels of Abstraction
Level 1: System Context Diagram - The highest level of abstraction. It shows your system as a black box in its environment, interacting with users and other systems.
Level 2: Container Diagram - Zooms into the system to show its high-level building blocks or "containers."
Level 3: Component Diagram - Zooms into an individual container to show its internal components.
Level 4: Code Diagram - Zooms into an individual component to show its implementation details.
Why Use the C4 Model?
Improved Communication: It creates a common language for describing architecture, bridging the gap between technical and non-technical teams.
Clarity and Consistency: It provides a simple, consistent, and easy-to-understand set of diagrams.
Collaborative: The notation is simple enough for collaborative sketching sessions on a whiteboard.
Focus on Storytelling: It helps you tell the story of your architecture at different levels of detail.