Google Maps Analogy
In the introduction, we ended on a promise: the C4 model is Google Maps for your software. This section makes good on that promise. If you internalize this one analogy, every diagram that follows will feel obvious โ because you already use exactly this mental model every time you open a map on your phone.
The problem a map solves
Imagine you wanted to represent the entire world on a single piece of paper, showing every country, every city, every street, and every front door โ all at once, all readable. It's impossible. Either the paper is the size of a football field, or the detail is so dense it's an unusable smudge of ink.
This is precisely the trap that the forty-seven-box diagram from our introduction fell into. It tried to be a single, all-seeing picture of the entire system, and in doing so it became useful to no one.
Google Maps solves this with one elegant trick: it never shows you everything at once. Instead, it gives you a stack of views at different zoom levels, and lets you decide how much detail you need for the question you're actually asking. Planning a road trip across the country? Zoom out. Looking for the coffee shop's front door? Zoom all the way in. Each view is complete and readable for its purpose, and ruthlessly hides everything irrelevant to that purpose.
The C4 model applies this exact discipline to software architecture. Rather than one diagram that tries to say everything, you draw a small set of diagrams at increasing levels of detail. Each one answers a specific question for a specific audience โ and hides the rest.
Zooming through your software
Here's the mapping at the heart of C4. As you zoom in, you move from the widest possible view of your system down to its finest implementation detail.
| Map zoom level | What you see on a map | C4 level | What you see in your software |
|---|---|---|---|
| ๐ Country / Continent | Whole nations and the borders between them | Level 1 โ System Context | Your system as a single box, plus the users and external systems it talks to |
| ๐๏ธ City | Districts, major roads, how neighborhoods connect | Level 2 โ Container | The high-level building blocks: web apps, APIs, databases, and how they connect |
| ๐ฃ๏ธ Street / Building | Individual streets and the buildings on them | Level 3 โ Component | The major components inside a single container and their responsibilities |
| ๐ช Individual rooms | The layout of rooms inside one building | Level 4 โ Code | How one component is implemented โ classes, interfaces, functions |
Read that table top to bottom and you've just taken the entire tour of C4. Everything else in this guide is simply a closer look at each row.
๐ Level 1 โ The country view (System Context)
When you're looking at a whole continent, you don't see individual streets, and you wouldn't want to. You see countries and how they border and connect to one another.
At this zoom level in C4, your entire system is a single box. You're not looking inside it at all. What you are showing is the world around it: the people who use it and the other systems it depends on or integrates with. It's the view you'd give to a non-technical stakeholder who just wants to understand, "what is this thing, who uses it, and what does it talk to?"
๐๏ธ Level 2 โ The city view (Container)
Zoom into a single country and you start to see its cities โ the distinct places where things actually happen, and the major roads linking them.
Zoom into your system's single box and you reveal its containers: the separately runnable or deployable pieces that make it up. A single-page web app, a mobile app, a backend API, a database, a message queue. This is the first view that shows real technology choices, and it answers, "what are the major moving parts, and how do they communicate?" (A quick heads-up we'll repeat later: in C4, a "container" is any independently runnable thing โ it is not specifically a Docker container.)
๐ฃ๏ธ Level 3 โ The street view (Component)
Zoom into a city and you finally see individual streets and the buildings that line them.
Zoom into a single container and you reveal its components: the major logical building blocks inside it, each with a clear responsibility, like a "Payment Service" or a "Security" component. This view is for the developers working inside that container, answering, "how is this one piece structured internally, and how do its parts collaborate?"
๐ช Level 4 โ Inside the building (Code)
Zoom in as far as the map will go and you're looking at the floor plan of a single building โ the individual rooms.
Zoom into a single component and you reach the code: the classes, interfaces, and functions that actually implement it. As we'll discuss later, most teams deliberately don't draw this level by hand, because it changes constantly and your IDE can generate it on demand. But conceptually, it's the final, deepest zoom.
Two rules that make the magic work
The analogy is more than a friendly picture โ it encodes two disciplines that are the whole reason C4 works.
One level of abstraction per diagram. A good map never mixes zoom levels. You'll never see a country map that suddenly renders one random street in full detail while leaving everything else as a blurry outline. Likewise, a C4 Container diagram shows only containers โ it doesn't randomly zoom into one container's internal classes. Keeping each diagram at a single, consistent altitude is exactly what our chaotic forty-seven-box diagram failed to do, and it's the single most important habit C4 instills.
Every diagram has one job and one audience. You reach for the country view and the street view at completely different moments, to answer completely different questions. In the same way, you hand the System Context diagram to an executive and the Component diagram to a developer. Each C4 diagram is self-contained and purpose-built, so nobody has to wade through detail that's irrelevant to their question.
Where the analogy (gently) bends
No analogy is perfect, and it's worth naming one small difference so it doesn't trip you up later. On Google Maps, zooming is continuous and infinite โ you can stop at any arbitrary altitude. C4 is deliberately discrete: there are exactly four named levels, chosen because they map to how software is actually built (systems, deployable containers, internal components, and code). Think of it less like a smooth zoom slider and more like four well-chosen bookmarks โ "country," "city," "street," and "room" โ that you can jump between cleanly. That constraint is a feature: it's what gives every team a shared, predictable vocabulary.
With the map firmly in mind, we're ready to plant our feet on the ground and draw our first real diagram. In the next section, we zoom out as far as we can go and start with the country view: the System Context diagram.
Previous: โ The Problem with "Boxes and Arrows" ยท Next: Level 1: System Context โ