Skip to main content Link Menu Expand (external link) Document Search Copy Copied

C4 Model

The C4 model is an “[abstraction]-first” approach to diagramming software architecture, based upon abstractions that reflect how software architects and developers think about and build software. The small set of abstractions and diagram types makes the C4 model easy to learn and use.

Four Levels of C4 Models

There are four types of C4 models, each one for a different audience and containing a different level of detail. These are the context, container, components, and code diagrams that make up your C4 model.

Level 1: Context Diagrams

Context diagrams are the most general description of what your system does, who will use it, and what other systems it will interact with. A context diagram will help you describe the scope of your project and help you pinpoint who the user is and what problem you’re going to solve.

Level 2: Container Diagrams

The container diagram takes the first step into describing the software system and shows the APIs, applications, databases, and microservices that the system will use. Each of these applications or services is represented with a container and the interactions between them are shown at a high level.

Level 3: Component Diagrams

One step deeper than the container diagram, the component diagram details groups of code within a single container. These components represent abstractions of your codebase.

This diagram type is comparable to a UML component diagram, but follows a less-strict set of “rules” in order to create the software architecture diagram.

Level 4: Representing Code with Class Diagrams

The last level requires lots of detail to show how the code of a single component is actually implemented. To do this, you would want to make a UML class diagram or entity relationship diagram that describes the component.

Representing Software with All Four Levels

Depending on your project and the containers or components you need to describe, you’ll end up having a set of four or more diagrams that represent your C4 model. If you make a C4 model in Gliffy, you can use links directly on shapes in your diagrams to allow users to double-click into deeper levels of your model.