How would you maintain a C4 Model that describes multiple microservices and the communication between them? A separate repo? Document it in the api gateway (if you have one)? Let each microservice push it's own C4 Models to a service that collects & combines them? Cheers!
Hello Martin, thanks for the question. What you're asking is *really* interesting and all your ideas make sense to me. I made a similar decision for the projects I currently oversee, there's repository that aggregates all the documentation for all of our services and consolidates everything using a combination of markdown files and the generated diagrams; this documentation monorepo is linked to the other repos via submodules and gets its "build/publish" CI/CD step triggered after any of the other upstream projects pushes any change to the main branch. With that said, all projects still maintain their own documentation and have control of what to document but this documentation monorepo is in charge of aggregating and consolidating everything that we think makes sense to make available to other teams. I hope that helps, Best
One approach I have been a bit interested in is to utilise a Distributed Tracing tool like Open Telemetry to capture the communication between C4-containers and then basically auto-create the C4 model that describes the connections between multiple micro-services. The main benefit in my view with this is that you don't end up with a model that is wrong because someone updated the code, but not the documentation.
Fredrik, that's a great idea; I'm not sure if OpenTelemetry supports anything like that just yet, but I assume implementing something to collect those metrics to build diagrams automatically could be possible; I know some third party providers like NewRelic automatically create diagrams (not C4 though) that allow you to see how the different services talk to each other.
@@MarioCarrion I don't think OTel will ever support building C4 diagrams, but as you say, you could have another tool use the OTel data to build C4 diagrams. At my previous job, we used Datadog, which also builds a dynamic service-map based on the metrics, but you didn't get the layering as with the C4 model. The cool thing with using a tool like Datadog is that you technically could get all info you would need to build the first three C4 layers. By using tracing across all your applications, tagging client-actions with user-roles and tagging your services and infrastructure with things like system or product, etc. Unfortunately, Datadog doesn't really support exporting its data for this purpose...
@@MarioCarrion I wrote a short article to give this example. I've posted it here twice, but it keeps disappearing so I will not repost. But @Vikram Singh Rawat ज्ञानखोजी seems to be asking about a similar example.
*Blog* mariocarrion.com/
*Learning Golang* th-cam.com/play/PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy.html
*Building Microservices in Go* th-cam.com/play/PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu.html
*Software Architecture in Go* th-cam.com/play/PL7yAAGMOat_GCd12Lrv_evJ3Zhv1dl8B-.html
*Go Tools and Packages* th-cam.com/play/PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3.html
*Testing in Go* th-cam.com/play/PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq.html
*Keep it up!*
Amazing content! Extremely practical and useful, your channel is way underrated. I hope the channel gains the popularity it deserves.
Thanks Piyush! Take care.
Ur channel is a treasure man !! u r a legend.
Amazing content !!
😀Thanks! Take care.
Awesome channel for Go
Thanks!
How would you maintain a C4 Model that describes multiple microservices and the communication between them? A separate repo? Document it in the api gateway (if you have one)? Let each microservice push it's own C4 Models to a service that collects & combines them?
Cheers!
Hello Martin, thanks for the question.
What you're asking is *really* interesting and all your ideas make sense to me. I made a similar decision for the projects I currently oversee, there's repository that aggregates all the documentation for all of our services and consolidates everything using a combination of markdown files and the generated diagrams; this documentation monorepo is linked to the other repos via submodules and gets its "build/publish" CI/CD step triggered after any of the other upstream projects pushes any change to the main branch.
With that said, all projects still maintain their own documentation and have control of what to document but this documentation monorepo is in charge of aggregating and consolidating everything that we think makes sense to make available to other teams.
I hope that helps,
Best
One approach I have been a bit interested in is to utilise a Distributed Tracing tool like Open Telemetry to capture the communication between C4-containers and then basically auto-create the C4 model that describes the connections between multiple micro-services.
The main benefit in my view with this is that you don't end up with a model that is wrong because someone updated the code, but not the documentation.
Fredrik, that's a great idea; I'm not sure if OpenTelemetry supports anything like that just yet, but I assume implementing something to collect those metrics to build diagrams automatically could be possible; I know some third party providers like NewRelic automatically create diagrams (not C4 though) that allow you to see how the different services talk to each other.
@@MarioCarrion I don't think OTel will ever support building C4 diagrams, but as you say, you could have another tool use the OTel data to build C4 diagrams.
At my previous job, we used Datadog, which also builds a dynamic service-map based on the metrics, but you didn't get the layering as with the C4 model.
The cool thing with using a tool like Datadog is that you technically could get all info you would need to build the first three C4 layers. By using tracing across all your applications, tagging client-actions with user-roles and tagging your services and infrastructure with things like system or product, etc. Unfortunately, Datadog doesn't really support exporting its data for this purpose...
Thanks for making this brudduh
I think mermaid.js can also be used to create and visualize c4 models. Especially because of the ability to click on nodes in mermaid.
Hey Brian, do you have a link to an example where nodes are clickable? I used mermaid in the past but I'm not familiar with that feature.
I don't think mermaid has this feature
@@MarioCarrion I wrote a short article to give this example. I've posted it here twice, but it keeps disappearing so I will not repost. But @Vikram Singh Rawat ज्ञानखोजी seems to be asking about a similar example.
Thank u for sharing
Really great content!!! Thank you so much! Any udemy courses planned?
Hello, yes I'm working on a few courses. I will share the news when those are available.
@@MarioCarrion do you have a mailing list where we can get updated?
@@charliecooper7655 I do not, but I will share the news in the channel as soon as I have more details.