C4 — Architecture Model
This guide is split into three parts, and you are on Short info. Continue with the tutorial or browse the samples.
Summary
Section titled “Summary”C4 answers: what are the major parts of the system at this level of architectural detail?
When to use it
Section titled “When to use it”Use it to explain system scope and structure to a particular audience. Start with a system context view, then add containers only when the audience needs deployable-unit detail. A container means an application or data store at this abstraction level; it does not necessarily mean a Docker container.
Common mistakes
Section titled “Common mistakes”- Mixing a database table, a deployable API and an entire software system at one zoom level.
- Using generic relationship labels that leave the purpose unclear.
- Treating multiple drawings as separate, inconsistent copies of the architecture.
Background and history
Section titled “Background and history”Simon Brown developed C4 through architecture workshops in the mid-2000s; his history of C4 explains the communication problems that motivated it. The C4 introduction describes why unexplained notation and mixed levels make diagrams hard to understand. ContextBrew stores a model whose elements can participate in named views and cross-model links.
Choose one level of abstraction per view. A person, a system and its external dependencies tell a different story from components inside an application. Label relationships with their purpose, and include technology details where they help the audience. More detail is not automatically better: many teams get substantial value from context and container views. Link the architecture to domain and storage models without treating their objects as interchangeable.
Alternatives and trade-offs
Section titled “Alternatives and trade-offs”UML component/deployment diagrams, ArchiMate and informal architecture sketches offer different scopes and notation costs. Structurizr is a C4 modeling tool rather than an alternative method. SIM adds integration contracts; DDD describes domain meaning.
References
Section titled “References”- history of C4
- C4 introduction
- Learning with models — choose a practice workflow and interpret its results.
Where it fits
Section titled “Where it fits”| Model | Captures | Level of zoom |
|---|---|---|
| DDD | Domain (aggregates, invariants, events) | Domain |
| SCM | Screens + navigations | User-facing |
| C4 | Architecture (persons, systems, containers, components) | Static structure |
| SIM | Services + integration contracts | Runtime |
File format
Section titled “File format”The C4 model is stored as models/c4.json. See the c4 schema page for the normative JSON Schema, every property table, and committed sample files.
Levels
Section titled “Levels”- System Context — persons + software systems + the relationships between them. Shows how the system fits in the world.
- Container — the deployable units (web apps, APIs, databases, message buses) inside the system-under-design.
- Component — the meaningful internal groupings inside a single container.
- Code — usually too low; we skip this level in ContextBrew because DDD aggregates and DSM tables cover it.
Cross-model links
Section titled “Cross-model links”C4 elements carry an externalId field that links to the corresponding entity in the other models — e.g. a C4 softwareSystem links to a DDD domain, a C4 container can link to a DSM table cluster, and a C4 person links to a USM persona.
