C4 Diagram

  • The C4 model is a way of documenting software architecture at four levels of zoom, each aimed at a different audience.
  • The C4 model is a way of documenting software architecture at four levels of zoom — each level answering a different question for a different audience, from "what does this system do" down to "how is this class structured."
  • The four levels, in Simon Brown's original formulation:
    • System context — your system as one box, surrounded by the people (actors) and other systems it talks to. No technology detail. This is the diagram you'd show a non-technical stakeholder to answer "what is this thing and who uses it."
    • Container — zooms into the system to show its major deployable/runnable pieces: a Spring Boot service, a React frontend, a PostgreSQL database, a message queue. Each container is something you could deploy independently. This is the level most engineers mean when they say "architecture diagram."
    • Component — zooms into one container to show the major logical groupings inside it — e.g. inside a Spring Boot service, your OrderController, PaymentService, InventoryRepository layers. Useful for onboarding someone onto that specific codebase.
    • Code — optional, and usually auto-generated (UML class diagrams from your IDE) rather than hand-drawn. Most teams skip this level in practice since it goes stale fast.

No comments:

Post a Comment

Recursion

Q What do you understand by a Recursive  Programme? Recursion Is the process of repeating items in a self similar way. In programming langua...