C4 and diagramming for audiences
Use the C4 model to draw diagrams at the right level of detail for each audience.
13 min readMost diagrams fail the reader
The typical architecture diagram mixes levels: a user icon, a Kubernetes cluster, a Kafka topic and a class name all in one picture, joined by unlabelled arrows. Nobody can read it, so nobody uses it. Simon Brown's C4 model fixes this with four zoom levels, each with a clear audience, like the zoom levels on a map. Pick the level first, then decide what to draw. Each diagram answers one question for one audience, and you will usually need a small set of diagrams rather than one huge poster that tries to answer everything at once.
The four levels
Draw only the levels your audience needs. Most teams get most of the value from levels one and two; level four is usually generated from code or skipped.
- Context: your system as one box, with its users and external systems. Audience: everyone, including executives
- Container: the deployable units (web app, API, database, queue) and how they talk. Audience: engineers and ops
- Component: the major parts inside one container. Audience: the team that builds it
- Code: classes and functions. Audience: individual developers, rarely worth drawing by hand
Rules for readable diagrams
A diagram should be understandable without the person who drew it standing next to it. Use a title that says what and at which level. Label every arrow with intent and protocol ('places order, HTTPS/JSON'), not just a line. Include a legend for shapes and colours. Show trust boundaries and data stores explicitly. Keep it to around 15-20 elements; if it needs more, split it. The SystCode canvas is effectively a container diagram: every node is a deployable thing, and every edge should carry a clear purpose.
Supplementary views
C4 shows static structure. Add other views when the question requires it: a sequence diagram for a tricky flow such as checkout with retries, a deployment diagram for regions and availability zones, and a data-flow diagram with trust boundaries for threat modelling. Keep diagrams as code (Structurizr, Mermaid, PlantUML) where possible so they live in the repo and are updated in the same pull request as the change. Link each view from the design doc where it is discussed.
Key takeaways
- C4 gives four zoom levels: context, container, component, code; pick the level for the audience.
- Label every arrow with intent and protocol, add a legend, and keep to about 20 elements.
- Add sequence, deployment and data-flow views when structure alone cannot answer the question.
- Keep diagrams as code in the repo so they change with the system.
Sign in to track lessons and earn badges.