Software Architecture in Golang: C4 Model for Diagraming and Documentation

Опубликовано: 11 Октябрь 2024
на канале: Mario Carrion
17,515
359

C4 Model is sort of a slim UML where only the relevant data is presented to the user that happens to be interested in learning about the Software Architecture being described. In practice what this means is that the consumer of the diagram is who drives how much information is displayed.

The C4 Model defines four levels of diagrams:

Context (L1): the highest level, it shows how the system relates to users and other systems. It is used as a quick introduction to the system, usually meant to be presented to stakeholders, this is the big picture diagram.
Container (L2): breaks down the system into interrelated containers, containers are executable and deployable sub-systems. It is meant to be shared with people that need more technical details about how the system is composed.
Component (L3): takes the containers and decomposes them into interrelated components, relates them to other containers or other systems. It is meant to be read by engineers not familiar with the system that are planning to work on it.
Code (L4): provides more details about how the actual code is being implemented. It is meant to clearly display some concrete details about the most complex pieces of the system.

---

RELEVANT LINKS

Using the C4 model to document Software Architectures: https://mariocarrion.com/2020/12/30/d...
Example code: https://github.com/MarioCarrion/todo-...
Structurizr is a collection of tooling to create software architecture diagrams and documentation based upon the C4 model. : https://structurizr.com/
goadesign/model DSL for generating C4 Models compatible with Structurizr: https://github.com/goadesign/model
Using the C4 Model to document Software Architectures: https://gitlab.com/MarioCarrion/blog-...
C4-PlantUML combines the benefits of PlantUML and the C4 model for providing a simple way of describing and communicate software architectures: https://github.com/plantuml-stdlib/C4...

Example code: https://github.com/MarioCarrion/todo-...
Previous Episode: "Golang Microservices: Graceful Shutdown":    • Golang Microservices: Graceful Shutdown  

Playlist "Learning Golang":    • Learning Go/Golang  
Playlist "Building Microservices in Go/Golang":    • Building Microservices in Golang/Go  
Playlist "Golang Tools and Packages":    • Golang/Go Tools and Packages  
Playlist "Testing in Go":    • Testing in Golang/Go  

00:00 Start
01:20 What is the C4 Model?
01:41 How to use the C4 Model?
03:43 C4 Model with GOA
08:45 C4 Model with Structurizr
10:58 C4 Model with PlantUML
14:12 C4 Model Conclusions

---

Who am I:

Hello👋🏼! I'm Mario, a Hands-on Software Architect and Lead Backend Engineer with more than 16 years of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices.

Every week I will share with you different topics I've learned while working for small startups and large companies including the processes I've followed over the years for successfully delivering complex enterprise systems from start to end.

Subscribe if you like Software Development, Software Architecture and Systems Design!

Keep it up. Don't give up!

#golang #microservices #softwarearchitecture

--- Our affiliate links below

Shop our Amazon favorites → https://www.amazon.com/shop/rubycarrion
Shop my IG feed on my LIKEtoKNOWit (LTK) page → https://www.liketoknow.it/RubyCarrion
Shop Top Deals and Featured Offers at Best Buy → https://bestbuy.7tiv.net/c/2558226/68...
Get a 30 day FREE Trial of Epidemic Sound → https://www.epidemicsound.com/referra...
Try Amazon Prime 30-day FREE Trial → https://amzn.to/3yf9a0f
I love getting Cash Back and think you will too! Join for FREE and get $30 when you spend $30. https://www.rakuten.com/r/RUBYRA132?e...

--- Our Vlog Channel

   / rubycarrion