Skip to content
BENIBIX Learn

C4 Model

Development🏗️ ArchitectureArchitecture Basics

Also known as C4 Diagrams, C4 Architecture Model, C4 Model Diagram

Four zoom levels for drawing software. Start with the big map and end at the code.

Think of it like

It is like a map app. You zoom from the country to the city, then to one street.

Example

Emma joins a team that runs an online shop. Its context diagram shows shoppers, the shop and the payment service. The container diagram then shows the web app, the API and the database.

Why it matters

Each reader gets the level they need. A manager reads the first map, and a new developer zooms in to the third.

Definition

The C4 model is a way to draw software at four levels of zoom. The first level, system context, shows your system, the people who use it and the other systems it talks to. The second, containers, shows the apps and data stores inside it. The third, components, opens one container to show its main parts. The fourth, code, shows classes and is rarely drawn. Simon Brown made it, and it works with any drawing tool.
Each level opens one box from the level before. First the shop, then its API, then the orders part.

Common mistake

Reading container as a Docker container. In C4 it means any app or data store that runs, like a web app, a phone app or a database.

Key takeaways

  1. 1
    Four zoom levels. Context, containers, components, then code.
  2. 2
    Any tool. No special symbols or tool needed.
  3. 3
    Draw the top. Most teams stop at containers or components.

Compare