System Design Space
Knowledge graphSettings

Updated: February 21, 2026 at 11:59 PM

C4 Model: context, containers, components, code

mid

Practical guide to the C4 Model based on the official website: 4 levels of diagrams, notation and workflow modeling.

Source

Official website of C4 Model

Key principles, diagram levels, notation and examples from Simon Brown.

Open c4model.com
ContextContainerComponentCode

C4 Model — a developer-friendly approach, where the architecture is broken down into levels of abstraction. The main idea: to show the system at the right level of approximation for a specific audience, and not to explain everything with one overloaded diagram.

4 levels C4

L1

System Context

One system surrounded by people and external systems.

Audience: Technical and non-technical audiences.

Recommendation for use: Yes, almost always.

L2

Container

Applications and storage within the system (web app, API, DB, queue, etc).

Audience: Architects, developers, ops/support.

Recommendation for use: Yes, a basic level for teams.

L3

Component

Components inside the selected container.

Audience: Architects and developers.

Recommendation for use: Optional if it really adds value.

L4

Code

Code elements of a specific component (classes/interfaces/tables).

Audience: Developers.

Recommendation for use: Probably not; It's better to generate from tooling on request.

Examples of C4 diagrams

Examples in the format from the UML chapter: select a diagram type and see the corresponding visualization.

Context Example

User, external systems and one target platform on L1.

UserWeb / MobileSubscription PlatformPlans + BillingNotifications + MetricsPayment PSPcharge / refundCRMsupport eventsgetSubscriptionStatepayment APIevents

Details

Diagrams

Recommendations for core and supporting diagrams.

Open section

Supporting charts

System Landscape

Map of systems at the organization/domain level.

Dynamic

Scenario of interactions over time for a specific use case.

Deployment

Placement of containers and systems by environment (prod/stage/dev).

Notation

Notation Guidelines

Practical rules for describing elements and connections.

Open section

Notation checklist

Naming

Each element has a name and a short description.

Technologies

For containers and components, the technology is explicitly specified.

Connections

Directed connections, with a signature and clear intent.

Protocol

For inter-container communications, explicitly specify the protocol/technology.

Legend

Add legend/key to make the notation self-documenting.

Tool-agnostic

C4 is not tied to a specific tool or visualization style.

Practical workflow

Шаги C4 workflow

5 этапов от границ системы до runtime-представления
Foundation
Decomposition
Runtime
01

Контекст

Начинайте с System Context, чтобы зафиксировать границы и внешние зависимости.

02

Контейнеры

Добавляйте Container диаграмму как основной рабочий слой архитектуры.

03

Компоненты

Компоненты рисуйте только для важных/сложных контейнеров.

04

Код

Code-уровень оставляйте для сложных мест и генерируйте из кода.

05

Runtime + Infra

Для сценариев и среды развертывания используйте Dynamic и Deployment.

Нажмите «Запуск», чтобы пройти workflow C4 пошагово.

Common mistakes

Start too deep

Immediately start with component/code without context/container.

Blurred connections

Sign connections with general words like `uses` without specifics.

One poster for everything

Trying to show everything on one diagram and losing readability.

Manual L4 synchronization

Store code diagrams manually without auto-updating from sources.

Related chapters

Enable tracking in Settings

System Design Space

© 2026 Alexander Polomodov