System Design — C4 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.” — https://c4model.com/
Have you ever tried to express yourself in a System Design meeting and found drawing those squares and circles and in the end became a big mess? Well C4 tries to address that in a fashionable way. Having 4 tiers of diagrams(Context, Containers, Components and Code), the one I most enjoyed is called Containers.
Not Docker! In the C4 model, a container represents an application or a data store. A container is something that needs to be running in order for the overall software system to work. In real terms, a container is something like:
Server-side web application: A Java EE web application running on Apache Tomcat, an ASP.NET MVC application running on Microsoft IIS, a Ruby on Rails application running on WEBrick, a Node.js application, etc.
Client-side desktop application: A Windows desktop application written using WPF, an OS X desktop application written using Objective-C, a cross-platform desktop application written using JavaFX, etc.
Mobile app: An Apple iOS app, an Android app, a Microsoft Windows Phone app, etc.
Server-side console application: A standalone (e.g. “public static void main”) application, a batch process, etc.
Serverless function: A single serverless function (e.g. Amazon Lambda, Azure Function, etc).
Database: A schema or database in a relational database management system, document store, graph database, etc such as MySQL, Microsoft SQL Server, Oracle Database, MongoDB, Riak, Cassandra, Neo4j, etc.
Blob or content store: A blob store (e.g. Amazon S3, Microsoft Azure Blob Storage, etc) or content delivery network (e.g. Akamai, Amazon CloudFront, etc).
File system: A full local file system or a portion of a larger networked file system (e.g. SAN, NAS, etc).
Shell script: A single shell script written in Bash, etc.
A container is essentially a context or boundary inside which some code is executed or some data is stored. And each container is a separately deployable/runnable thing or runtime environment, typically (but not always) running in its own process space. Because of this, communication between containers typically takes the form of an inter-process communication. — https://c4model.com/
See one example as an Asset Trading System Architecture in an old fashion way below:
Now let’s take it into a C4 Model (Containers):
In order to produce the C4 Model, I used a plugin in draw.io. Can be found here: https://github.com/tobiashochguertel/c4-draw.io
But note how clean and easy to understand is the diagram above, I really enjoyed the exercise.
If you got to here, please support! Leave a clap.