C4/Diagram/2 - Containers
Overview
Context
Key principles
- Technology honesty — Name stacks where it aids comprehension (“PostgreSQL”, “Kotlin service”, …).
- Communication edges — Prefer labelled relationships over a spaghetti of anonymous lines.
Mechanism
Examples
- Browser SPA → BFF API → domain services → OLTP database + object store for attachments.
Misconceptions
- “One box per repo” — Heuristic at best; some repos host multiple containers, or one container spans repos—model runtimes, not git topology.
- “Same as deployment diagram” — Different question; C4/Diagram/Deployment maps software to infrastructure, not only logical containers.