Starting your software architecture journey with the C4 model

Amir Shazlan
3 min readJan 9, 2021

--

I have been building software for the whole of my career. Started off being a noob developer (still am) to business analyst, then afterwards spending a huge chunk of time involved in testing. But now in the past six months I have been taking on a responsibility never attempted before — architecting solutions.

A huge part of building solution is to communicate and align with users about how their end-goals can be achieved through the use of software. And this requires looking at diagram as a way to build mental models that forms the basis of discussion. But these diagrams/models comes in many shape, sizes and forms.

In the course of reading up (or rather digging up) old requirements to support existing applications, I found different architecture diagrams that comes in many shapes and sizes. However this does not make the knowledge much clearer as I had to read the finer lines in the documents to piece together information and confirm the diagrams.

Enter the C4 model for visualizing software architecture.

I stumbled upon this while reading up stuff and was blown away by the simplicity of the implementation. In a nutshell, C4 talks about software being an abstraction that can be explained in four different level- Context, Container, Component and Code (hence the C4).

Context is the starting point and it explains how the application or software system behaves or fit into the world around it. The next level is the Container which is actually explaining the building blocks of the application or software system itself. The third level of abstraction is the Component diagram, which zooms into each individual building blocks and showing the components inside it. Lastly the Code level shows how the component is implemented from the actual source code perspective.

In essence, navigating though the C4 model is a lot like viewing Google Maps. If you try to type in an address that is outside of your country, the maps flies around and starts showing the country, then zooms down to the state and then further zooms in to the road address. This idea of zooming in is what appeals to me regarding the C4 model.

Different levels of zoom allow you to tell different stories to different audiences

The level of abstraction also allows for explaining the software diagram to different audiences. In a few presentations where I utilized the C4 model, the business users can appreciate and understand the Context diagram. However I seem to have lost their interest once I zoom into the deeper abstractions. But utilizing the Container and Component diagrams with architects, analyst and the likes draws a much more robust discussion. This is the clear benefits of communicating ideas using the C4 model.

Another great point regarding the model is the level of information I can glean by looking at all the C4 diagrams. Every box and line has a clear standard definition that can be understood on its own. I don't have to read through the lines to understand what component A sends to component B, rather on a higher level I can just read the diagram. In short any architecture modeled using C4 can stand on its own, which is a highly valuable time saver.

So this is the end of a short Saturday morning riff on why I think the C4 model is a great starting point for beginners like me to understand software architecture. To conclude, let me close off with a sentence, lifted from the site that perfectly describes the model

“The C4 model is an “abstraction-first” approach to diagramming software architecture, based upon abstractions that reflect how software architects and developers think about and build software. The small set of abstractions and diagram types makes the C4 model easy to learn and use.”

--

--

Amir Shazlan
Amir Shazlan

Written by Amir Shazlan

I collaborate with people to build better software systems

No responses yet