C4 Model concept page. Simon Brown's 4 levels of architecture diagrams: Context (system + actors + external systems), Container (deployable units like SPA/API/DB/queue), Component (modules inside a container like Controllers/Services/Repositories), Code (class diagrams, optional). 4 scenarios: L1 Context overview, drill L1->L2 Container, drill L2->L3 Component, diagrams-as-code workflow with Structurizr DSL + PR review. 2 ADRs: C4 vs UML/ad-hoc justification, and Structurizr DSL / PlantUML / Mermaid C4 tooling choice.
C4 — notation- and tooling-independent approach to visualising software architecture at hierarchical zoom levels: System Context, Container, Component и Code. Supporting Landscape, Dynamic и Deployment diagrams answer other questions. Official guidance says use only levels that add value; Context/Container are sufficient for many teams, not mandatory proof of architecture correctness.
| Компонент | Ответственность |
|---|---|
| Customer [Person] | Внешний пользователь рассматриваемой software system. |
| Administrator [Person] | Оператор с отдельным relationship к admin surface. |
| Commerce [Software System] | System-in-scope на Context level. |
| Payment Provider [Software System] | Внешняя system dependency на Context level. |
| Web App [Container] | Deployable UI container на Container level. |
| API [Container] | Deployable application/API container и admin endpoint. |
| Orders DB [Container] | Data-store container; deployment topology shown separately. |
| Order Component [Component] | Cohesive functionality inside API container, not separate deployment. |
| C4 Model and View Generator | Хранит element identities, descriptions, technologies и relationships. |
For a broad audience, show Customer, Administrator, Commerce and Payment Provider with named relationships; do not mix containers or database internals into this view.
Проверяемый исход: Every person/external system relationship, including Administrator to Commerce, is visible and labelled.
For technical audiences, show Web, API, Orders DB and external Payment Provider with protocols and responsibilities. A C4 container means application/data-store deployable unit, not a Docker-only concept.
Проверяемый исход: Container boundaries and inter-process relationships are clear without component/code noise.
A team investigating order logic renders components inside API. The component is in-process and not portrayed as independently deployed.
Проверяемый исход: Component view exists only because it answers a concrete design/ownership question.
A Dynamic view orders one use-case interaction; a Deployment view maps containers to environment instances. Neither replaces the static model or runtime telemetry.
Проверяемый исход: Sequence and environment topology are explicit without claiming C4 verifies production behavior.
Числа здесь — размерностные формулы или явно помеченные учебные inputs. Паттерн архитектуры сам по себе не задаёт SLA, throughput, latency или fault tolerance.
[CONCEPT]architecture-decision-records
C4 communicates a model. It does not prescribe delivery process/team structure or prove security, resilience, code conformance, runtime sequence or deployed topology without additional evidence.
Введите числа или выберите пресет