c4 model

Abstract

C4 model is not new, but suggests a way to structure diagrams without the UML bagage. It’s split into a set of hierarchical abstractions, from bigger to smaller view:

  1. Context
  2. Containers
  3. Components
  4. Code

Most will only need to first 2 levels. There is also a tool that can be used to build “diagram as code”: structurizr.

Reviews

2024-08-22

Why did I want to read/watch this? I’m often in situation where I need to draw some diagrams to convey some technical principle, architecture, etc… For now, I’m only relying on easy to use tools like Excalidraw. However, once we want to collaborate, and especially if we want to version the diagram, such tool have their limits.

What did I get out of it? C4 model can be used to write the diagram as code and have it reviewed by my peers directly, which is nice. There are other tools that can be used for diagramming as code, like Mermaid, PlantUML, etc…