Verdalia already knows what it will draw with: text, inside the repository. What it still needs to know is what to draw. A tool does not say how many diagrams are needed, what should appear in each one, or in what order they should be read. In this lesson you will learn the C4 model, which answers those three questions with four levels of detail, like those of a map. You will see how diagrams are written as code, with three different tools, and how a diagram is generated from data instead of being written by hand. And you will learn which documentation is worth maintaining, which is far less than what usually gets written. Verdalia will end the lesson with a tidy docs/ folder and a deployment diagram that, for the first time, contains all ten of its machines.

The C4 Model

The C4 model, created by Simon Brown, proposes describing a software system with four levels of detail. Its author compares it to maps: one of the country, one of the region, one of the city, and the plan of a street. Nobody looks for a front door on the map of the country, or plans a trip with the plan of a street.

The model rests on four concepts, each contained in the previous one:

Concept What it is Example in Verdalia
Person Someone who uses the system A customer; Carmen, from customer support
Software system What the team builds and delivers, or a third-party system it depends on The Verdalia store; PagoRaíz
Container An application or a data store that runs separately The Flask store; the PostgreSQL database
Component A grouping of code inside a container, with one responsibility and one interface The orders module

The four levels take their names from what they show, and their initials give the model its name: context, containers, components, and code.

Level What it shows Question Audience How many diagrams How often it changes
1. Context The system as one box, with its users and the systems it interacts with What is it, who uses it, and what does it depend on? Everyone, including the business One Almost never
2. Containers The applications and data stores that make up the system, and how they communicate What runnable pieces is it made of? Technical profiles One A few times a year
3. Components The inside of a container How is it organized internally? Development One per container that deserves it Every few weeks
4. Code Classes, functions, and tables How is this component implemented? Whoever programs it Almost none Every day

Three ideas make the model useful:

  • Each level zooms into one box of the previous one. The reader never gets lost: they know where they came from.
  • Each level has its audience. It is the single-level-of-abstraction rule from the previous lesson, turned into a method.
  • The more detail, the faster it expires. That is why levels 1 and 2 are mandatory, level 3 is made only where it adds value, and level 4 almost never.

C4 imposes no notation. It asks that each element carry its name, its type, its technology, and one sentence saying what it does, and that each arrow say what it represents. The four rules from the previous lesson still apply.

“Container” Does Not Mean Docker

The term causes constant confusion, and it is worth clearing up before going on.

Container, in the C4 model Container, in Docker
What it is A design concept A packaging and runtime technology
Definition Something that must be running for the system to work: an application or a data store An isolated process, created from an image
Examples A web application, a database, a queue, a file store The store packaged with its dependencies
Does it depend on how it is deployed? No Yes

Verdalia's database is a container in the C4 sense, and it will never run in a Docker container. The store is a C4 container today, installed by hand on four machines, and it will remain one when it is packaged differently. We will deal with Docker containers in the lesson “Containers and Orchestration.” In this lesson, “container” always has the C4 meaning.

The Supplementary Diagrams

The four levels describe structure. C4 adds three diagrams for what structure does not tell:

Diagram What it shows Equivalent to
Deployment On which machines, networks, and environments each container runs The UML deployment diagram
Dynamic How the elements collaborate in a specific case, step by step The UML sequence diagram
System landscape Several systems of an organization and their relationships A context diagram of the whole company

The sequence diagram for confirming an order, which we drew in the previous lesson, is Verdalia's dynamic diagram. The landscape diagram is not needed: there is a single system.

Verdalia, Level 1: Context

flowchart TB
    customer(["Customer<br/>Buys plants and gardening products"])
    staff(["Verdalia staff<br/>Customer support, warehouse, and administration"])
    store["Verdalia store<br/>Catalog, cart, orders, payments, inventory, shipping, and notifications"]
    pagoraiz[["PagoRaíz<br/>Payment gateway"]]
    mail[["Email provider"]]
    images[["CDN and object storage<br/>Product images"]]
    customer -->|"Searches, buys, and checks their orders"| store
    staff -->|"Administers, through the panel"| store
    store -->|"Charges the orders"| pagoraiz
    store -->|"Requests the sending of emails"| mail
    mail -->|"Delivers the emails"| customer
    store -->|"Stores the images"| images
    images -->|"Serves the images"| customer

Legend: rounded shapes are people; the rectangle is the system Verdalia builds; double-bordered rectangles are third-party systems.

There are no technologies or machines. It is the diagram Andrés can show to an outsider, and the one that tells something the technical diagrams hide: Verdalia depends on three external providers, and one of them, PagoRaíz, is a single point of failure accepted in ADR-006.

Verdalia, Level 2: Containers

The “Verdalia store” box opens up:

flowchart TB
    customer(["Customer"])
    staff(["Verdalia staff"])
    subgraph system["Verdalia store"]
        store["Store<br/>Python and Flask<br/>Modular monolith, with the admin panel"]
        db[("Database<br/>PostgreSQL<br/>Orders, customers, catalog, and stock")]
        redis[("In-memory store<br/>Redis<br/>Sessions, carts, and cache")]
        queue["Message queue<br/>RabbitMQ"]
        api["Notifications API<br/>Python and Flask"]
        worker["Notification worker<br/>Python"]
        notif_store[("Notifications store")]
    end
    pagoraiz[["PagoRaíz"]]
    mail[["Email provider"]]
    customer -->|"HTTPS"| store
    staff -->|"HTTPS, via VPN"| store
    store -->|"SQL, with TLS"| db
    store -->|"Reads and writes"| redis
    store -->|"Publishes messages, AMQP"| queue
    store -->|"HTTP, with API key"| api
    queue -->|"Delivers messages"| worker
    api --> notif_store
    worker --> notif_store
    worker -->|"SMTP"| mail
    store -->|"HTTPS"| pagoraiz

Legend: rectangles are applications and cylinders are data stores. The CDN and the object storage have been omitted, since they already appear at level 1.

Several decisions from the course can be read in this diagram:

  • There are two deployable pieces, not seven. The store is a single container, as ADR-001 decided. The notification-service contributes two more, the API and the worker, as ADR-003 decided.
  • No arrow reaches the database from notifications. It is the design rule from Module 3, and here it is checked at a glance.
  • The load balancers and the bastion host do not appear. They are not containers: they are infrastructure. Their place is the deployment diagram.
  • The machines do not appear. This diagram will not change when the store moves to the cloud. The deployment diagram will change entirely.

Verdalia, Level 3: Components

Level 3 is only drawn where there is a structure to explain. In Verdalia it is drawn for the orders module and its collaborators, inside the “Store” container:

flowchart TB
    subgraph store["Container: Store"]
        subgraph orders["Orders module"]
            web["Web adapter<br/>Route /orders/confirm"]
            service["OrderService<br/>Confirmation rules"]
            repository["PostgresOrderRepository"]
            notifier["QueueNotifier"]
        end
        payments["Payments module<br/>PagoRaizGateway, with retries"]
        shipping["Shipping module<br/>Shipping cost calculation"]
        inventory["Inventory module<br/>Stock deduction"]
        events["EventPublisher and EventQueueBridge"]
    end
    db[("Database")]
    queue["Message queue"]
    pagoraiz[["PagoRaíz"]]
    web --> service
    service -->|"OrderRepository port"| repository
    service -->|"PaymentGateway port"| payments
    service -->|"Notifier port"| notifier
    service -->|"Calculates the cost"| shipping
    service -->|"Publishes order_confirmed"| events
    events -->|"Subscriber"| inventory
    repository --> db
    inventory --> db
    payments --> pagoraiz
    notifier -->|"emails.confirmation"| queue
    events -->|"warehouse.alerts"| queue

The other six modules have no component diagram. The catalog follows three layers that can be explained in a paragraph, and shipping is a family of classes with a factory. Drawing them would mean maintaining six diagrams nobody consults.

Level 4 and When Not to Draw It

Level 4 shows classes and functions. The class diagram of the orders module from the previous lesson is a level 4 diagram.

The model's own recommendation is not to maintain it. The code changes every day, and a hand-made class diagram is out of date before it is published. There are two reasonable exceptions:

  • Generate it on demand, with a tool that reads the code, when someone needs it, and do not keep it.
  • Draw a design decision, not an inventory. The orders diagram shows the ports and adapters rule. It will remain true as long as the rule is followed, even if the classes change.

Diagrams as Code

A diagram as code is a diagram described in a text file, from which a tool produces the image. It is part of a broader idea, documentation as code: treating documentation with the same practices as software.

Advantage What it means in practice
Versioning The diagram has a history. You can see what the system looked like in March
Review A change to the diagram is reviewed line by line, next to the code change that motivates it
Proximity It lives in the same repository as the code. There is no other tool to open
Generation Part of the diagrams is obtained from data, without writing them
Verification A program can check the diagram, as we did in the previous lesson
No vendor lock-in A text file will still be readable in twenty years

It has drawbacks too. The tool decides where to place each element, and large diagrams end up tangled. And someone who does not program can read the result, but will hardly edit it.

Three Tools

Tool How it works Strength Limitation
Mermaid Text inside a Markdown file. The browser or the repository service renders it Nothing to install Its C4-specific diagram type is experimental. Flowcharts with conventions are used instead
PlantUML, with C4-PlantUML Text in its own files. A program generates the images Covers all of UML. The C4-PlantUML library provides the model's elements The images have to be generated and stored, or integrated into publishing
Structurizr DSL A model is described, and separately the views wanted from it It is modeling, not drawing: an element is defined once and appears in every view One more tool to learn and to run

The Same Diagram, in Two Other Tools

The level 1 context diagram is written in Mermaid. Reduced to three elements, it would be written like this in PlantUML, with the C4-PlantUML library:

@startuml
!include <C4/C4_Context>

Person(customer, "Customer", "Buys plants and gardening products")
System(store, "Verdalia store", "Catalog, cart, orders, and shipping")
System_Ext(pagoraiz, "PagoRaíz", "Payment gateway")

Rel(customer, store, "Searches and buys", "HTTPS")
Rel(store, pagoraiz, "Charges the orders", "HTTPS")
@enduml

And like this in Structurizr DSL:

workspace "Verdalia" {
    model {
        customer = person "Customer"
        store = softwareSystem "Verdalia store"
        pagoraiz = softwareSystem "PagoRaíz" "Payment gateway" "External"

        customer -> store "Searches and buys"
        store -> pagoraiz "Charges the orders"
    }
    views {
        systemContext store "Context" {
            include *
            autolayout lr
        }
    }
}

The differences teach more than the similarities:

  • In Mermaid you describe shapes. In the level 1 diagram, (["..."]) is a rounded shape. That the shape means a person is a team convention the tool knows nothing about.
  • In C4-PlantUML you describe concepts. Person, System, and System_Ext have meaning. The tool chooses the shape and the color, and adds the legend.
  • In Structurizr, the model and the views are separate. The model block says what exists. The views block says what you want to see. Adding a container diagram does not require repeating the elements: that is the difference between drawing and modeling.

Verdalia sticks with Mermaid. With one system and six diagrams, consistency between views is maintained by hand effortlessly, and not installing anything weighs more. Structurizr would be the choice if the number of diagrams multiplied. The condition for revisiting it is noted in docs/README.md: more than fifteen diagrams, or a second system.

Generating the Deployment Diagram With Python

The deployment diagram is the one that changes the most, and the one that was the most out of date. It is also the most mechanical: one box per machine, grouped by zone. The list of machines from the previous lesson becomes a file, infrastructure/inventory.json, and the diagram is generated from it.

import json
from datetime import date

INVENTORY_JSON = """
[
  {"name": "verdalia-lb-01", "zone": "public", "ip": "10.0.0.11", "role": "Load balancer, active"},
  {"name": "verdalia-lb-02", "zone": "public", "ip": "10.0.0.12", "role": "Load balancer, passive"},
  {"name": "verdalia-bastion-01", "zone": "public", "ip": "10.0.0.21", "role": "Bastion host and VPN"},
  {"name": "verdalia-app-01", "zone": "application", "ip": "10.0.1.11", "role": "Store"},
  {"name": "verdalia-app-02", "zone": "application", "ip": "10.0.1.12", "role": "Store"},
  {"name": "verdalia-app-03", "zone": "application", "ip": "10.0.1.13", "role": "Store"},
  {"name": "verdalia-app-04", "zone": "application", "ip": "10.0.1.14", "role": "Store", "temporary": true},
  {"name": "verdalia-db-01", "zone": "data", "ip": "10.0.2.11", "role": "PostgreSQL, primary"},
  {"name": "verdalia-db-02", "zone": "data", "ip": "10.0.2.12", "role": "PostgreSQL, replica"},
  {"name": "verdalia-aux-01", "zone": "data", "ip": "10.0.2.21", "role": "Redis, RabbitMQ, and notifications"}
]
"""

ZONES = {
    "public": "Public zone, 10.0.0.0/24",
    "application": "Application zone, 10.0.1.0/24",
    "data": "Data zone, 10.0.2.0/24",
}
EXTERNAL = {
    "internet": "Customers, via the internet",
    "team": "Verdalia staff, via VPN",
    "pagoraiz": "PagoRaíz",
    "mail": "Email provider",
}
# Source, target, and label. Each endpoint is a machine, a zone, or an external element
CONNECTIONS = [
    ("internet", "verdalia-lb-01", "443, via the floating IP"),
    ("team", "verdalia-bastion-01", "51820, VPN"),
    ("verdalia-bastion-01", "verdalia-lb-01", "8443, panel"),
    ("verdalia-lb-01", "application", "8000, with TLS"),
    ("application", "verdalia-db-01", "5432, with TLS"),
    ("application", "verdalia-db-02", "5432, with TLS"),
    ("verdalia-db-01", "verdalia-db-02", "Replication"),
    ("application", "verdalia-aux-01", "6379, 5672, and 5001"),
    ("application", "pagoraiz", "443"),
    ("verdalia-aux-01", "mail", "587"),
]


def identifier(name):
    """Mermaid does not allow hyphens in node identifiers."""
    return name.replace("-", "_")


def node(machine):
    lines = [machine["name"], machine["ip"], machine["role"]]
    if machine.get("temporary"):
        lines.append("TEMPORARY")
    return f'{identifier(machine["name"])}["{"<br/>".join(lines)}"]'


def generate_deployment(inventory, connections, as_of):
    lines = ["flowchart TB",
             f"    %% Generated on {as_of:%Y-%m-%d} from the inventory. Do not edit by hand"]
    for key, label in EXTERNAL.items():
        lines.append(f'    {key}(["{label}"])')
    for key, label in ZONES.items():
        lines.append(f'    subgraph {key}["{label}"]')
        lines += ["        " + node(machine) for machine in inventory if machine["zone"] == key]
        lines.append("    end")

    known = set(EXTERNAL) | set(ZONES) | {machine["name"] for machine in inventory}
    for source, target, label in connections:
        for endpoint in (source, target):
            if endpoint not in known:
                raise ValueError(f"connection with an unknown endpoint: {endpoint}")
        lines.append(f'    {identifier(source)} -->|"{label}"| {identifier(target)}')
    return "\n".join(lines)


inventory = json.loads(INVENTORY_JSON)
print(generate_deployment(inventory, CONNECTIONS, date(2027, 5, 7)))

# Monday, May 10: verdalia-app-04 is returned and its line is deleted from the inventory
inventory = [machine for machine in inventory if not machine.get("temporary")]
text = generate_deployment(inventory, CONNECTIONS, date(2027, 5, 10))
print()
print("Machines:", len(inventory), "- verdalia-app-04 appears:", "verdalia-app-04" in text)

# A connection that mentions a machine that no longer exists
try:
    generate_deployment(inventory, CONNECTIONS + [("verdalia-lb-01", "verdalia-app-04", "8000")], date(2027, 5, 10))
except ValueError as error:
    print("Error:", error)

The first part of the output is the text of a diagram. Saved in docs/architecture/deployment.md, it looks like this:

flowchart TB
    %% Generated on 2027-05-07 from the inventory. Do not edit by hand
    internet(["Customers, via the internet"])
    team(["Verdalia staff, via VPN"])
    pagoraiz(["PagoRaíz"])
    mail(["Email provider"])
    subgraph public["Public zone, 10.0.0.0/24"]
        verdalia_lb_01["verdalia-lb-01<br/>10.0.0.11<br/>Load balancer, active"]
        verdalia_lb_02["verdalia-lb-02<br/>10.0.0.12<br/>Load balancer, passive"]
        verdalia_bastion_01["verdalia-bastion-01<br/>10.0.0.21<br/>Bastion host and VPN"]
    end
    subgraph application["Application zone, 10.0.1.0/24"]
        verdalia_app_01["verdalia-app-01<br/>10.0.1.11<br/>Store"]
        verdalia_app_02["verdalia-app-02<br/>10.0.1.12<br/>Store"]
        verdalia_app_03["verdalia-app-03<br/>10.0.1.13<br/>Store"]
        verdalia_app_04["verdalia-app-04<br/>10.0.1.14<br/>Store<br/>TEMPORARY"]
    end
    subgraph data["Data zone, 10.0.2.0/24"]
        verdalia_db_01["verdalia-db-01<br/>10.0.2.11<br/>PostgreSQL, primary"]
        verdalia_db_02["verdalia-db-02<br/>10.0.2.12<br/>PostgreSQL, replica"]
        verdalia_aux_01["verdalia-aux-01<br/>10.0.2.21<br/>Redis, RabbitMQ, and notifications"]
    end
    internet -->|"443, via the floating IP"| verdalia_lb_01
    team -->|"51820, VPN"| verdalia_bastion_01
    verdalia_bastion_01 -->|"8443, panel"| verdalia_lb_01
    verdalia_lb_01 -->|"8000, with TLS"| application
    application -->|"5432, with TLS"| verdalia_db_01
    application -->|"5432, with TLS"| verdalia_db_02
    verdalia_db_01 -->|"Replication"| verdalia_db_02
    application -->|"6379, 5672, and 5001"| verdalia_aux_01
    application -->|"443"| pagoraiz
    verdalia_aux_01 -->|"587"| mail

The rest of the output:

Machines: 9 - verdalia-app-04 appears: False
Error: connection with an unknown endpoint: verdalia-app-04

Explanation:

  • json.loads turns the inventory text into the same list of dictionaries from the previous lesson. In the repository, the text is in a file and is read with json.load.
  • identifier replaces the hyphens, which Mermaid does not allow in identifiers. The real name, hyphens included, goes in the label, in quotes.
  • node builds a machine's box. <br/> is a line break inside the label.
  • generate_deployment writes the diagram in three steps: the external elements, one subgraph block per zone with its machines, and the connections. The line starting with %% is a Mermaid comment: it warns that the file is not edited by hand.
  • Before writing a connection, it checks that both of its endpoints exist. If not, it stops with an error. A generated diagram can be incomplete, but it cannot mention what does not exist.
  • Connections are expressed between zones whenever possible, just like the firewall rules. That is why, when verdalia-app-04 is retired, none of them needs touching.

The diagram is the first to contain the ten machines, the three zones, and the bastion host. On Monday, May 10, Lucía returned verdalia-app-04, deleted one line from the inventory, and ran the program. The diagram was updated in the same change, reviewed by Íker. The checker from the previous lesson now runs over the remaining diagrams, which are indeed written by hand.

One weakness remains, and it is important: Lucía maintains the inventory by hand. If she installs a machine and does not record it, the diagram lies with perfect neatness. The definitive source of truth will not be a list that describes the infrastructure, but the code that creates it. We will see that in the lesson “Infrastructure as Code and Continuous Delivery (CI/CD).”

Minimum Viable Architecture Documentation

Documentation has a maintenance cost, like code. The useful question is not what could be documented, but what will be maintained.

Document Question it answers Reasonable size
Vision and context What is the system, for whom, with what goals, and under what constraints? One page, with the context diagram
C4 views What pieces is it made of, and where do they run? Containers, deployment, and the components that deserve it
Decision records, or ADRs Why is it like this? One or two pages per decision
Quality scenarios What must it meet, and does it? A table, with the last measurement and its date
Runbooks What do I do when this happens? One file per operation
Risk register What can go wrong, and what have we accepted? A table, with an owner

Deliberately left out is everything the code already tells: the list of classes, the routes, or the columns of each table.

For those who need a more complete structure there is arc42, a free template with twelve sections: goals, constraints, context, solution strategy, building block view, runtime view, deployment view, cross-cutting concepts, decisions, quality requirements, risks, and glossary. It combines well with C4, which provides the diagrams for several sections. Verdalia does not adopt it in full, but its folder covers the same topics with less ceremony.

Verdalia's docs Folder

docs/
    README.md                        Index, rules, and reading order
    architecture/
        vision.md                    Business goals, constraints, and context diagram
        containers.md                Level 2
        orders-components.md         Level 3, orders module only
        deployment.md                GENERATED from infrastructure/inventory.json
        confirm-order.md             Dynamic diagram
        quality-scenarios.md         QS-1 to QS-6, with their status and last measurement
    adr/
        adr-001-modular-monolith.md  ... up to adr-009
    runbooks/
        replica-promotion.md
        postgresql-restore.md
        server-setup.md              The 38-step checklist
    security/
        threats.md                   TH-01 to TH-16
        accepted-risks.md
        data-flow.md                 The whiteboard diagram, moved to Mermaid and corrected
infrastructure/
    inventory.json
tools/
    generate_deployment.py
    check_diagrams.py

The folders docs/adr/, docs/runbooks/, and docs/security/ already existed. docs/architecture/ is added, with six files. The reading order for newcomers is in the README.md: vision, containers, deployment, the titles of the ADRs, and, only if they are going to touch orders, its components.

The first complete version was published on Friday, May 7. The March diagram and the whiteboard photo were deleted. Lucía's spreadsheet was replaced by the inventory and by the table of rules, which had already been written as data since the validator in Module 5.

Keeping the Documentation Alive

Documentation does not die for lack of tools. It dies because updating it is not part of the job. Verdalia adopts five rules:

Rule How it is applied
The document changes in the same change as the system Whoever reviews a change asks: does it affect any diagram, runbook, or ADR? If it does and it has not been touched, the change is not approved
Every document has an owner Marta, the views and the vision; Íker, the components and the dynamic diagram; Lucía, the inventory and the runbooks
Every document carries its last review date One line at the top: Last reviewed: 2027-05-07, Marta. Reviewing without changing anything also counts, and it is recorded
Whatever can be generated is generated The deployment, today. Whatever is maintained by hand is checked with a program
Whatever nobody maintains is deleted Every quarter, documents that have gone more than six months without a review are examined. They are updated or removed

ADRs are the exception to the fourth and fifth rules. They are neither updated nor deleted, because they describe a decision at its moment. When the decision changes, a new ADR is written and the old one is marked as superseded.

Common Mistakes and Tips

  • Starting at level 3. Without context or containers, the reader does not know what they are looking at.
  • Confusing the C4 container with the Docker one. And, as a result, drawing only what is packaged.
  • Putting the machines in the container diagram. Where each piece runs belongs in the deployment diagram.
  • Drawing every component of every container. Level 3 is reserved for what has a structure to explain.
  • Editing a generated file by hand. The next person to generate it will wipe out the change. You change the data or the generator.
  • Storing the image and not the text. The source is the text.
  • Documenting a lot at the start and nothing afterward. Little and true is preferable.
  • Practical tip. Show the context diagram to someone from the business and the container diagram to someone who has just joined. If you have to explain them out loud, they are missing something.

Exercises

Exercise 1: Which Level It Belongs To

State which C4 diagram each statement belongs to:

  1. “The store publishes messages to RabbitMQ, and the worker consumes them.”
  2. “verdalia-db-02 is in the data zone, with the address 10.0.2.12.”
  3. “Customers pay through PagoRaíz.”
  4. “OrderService uses the PaymentGateway port.”
  5. “EconomyShipping inherits from ShippingMethod.”

Exercise 2: A New Container

For the “Plant of the Month” subscription, Íker proposes a process that runs on the 1st of every month, generates the subscribers' orders, and exits. It would be deployed with the same code as the store. State which of Verdalia's diagrams change and which do not.

Solutions

Solution to Exercise 1

  1. Containers: it talks about applications and how they communicate.
  2. Deployment: it talks about machines and networks.
  3. Context: it talks about people and external systems.
  4. Components: it talks about pieces inside a container.
  5. Code.

Solution to Exercise 2

  • Context. Does not change: the users and the external systems are the same.
  • Containers. Changes. The process runs separately, so it is a new container, even though it shares the code with the store. It will have arrows toward the database and toward the queue.
  • Orders components. Changes if the process uses OrderService, which would be desirable.
  • Deployment. Changes: it has to be decided which machine it runs on. Remember that Verdalia's scheduled jobs run only on verdalia-app-01, so that they are not launched in triplicate.

Common mistake: thinking that, because the code is the same, there is no new container. In C4, what defines a container is that it runs separately.

Conclusion

In this lesson you have learned the C4 model, which describes a system with four levels of detail: context, containers, components, and code. Each level zooms into one box of the previous one and addresses one audience. You have seen that a C4 container is an application or a data store, and not a Docker container. You have met the supplementary diagrams, deployment and dynamic. You have compared three ways of writing diagrams as code, Mermaid, C4-PlantUML, and Structurizr DSL, and you have generated a diagram from data. And you have learned that the documentation that survives is the minimum: vision, views, decisions, scenarios, runbooks, and risks, each with an owner and a review date.

In Verdalia, the docs/architecture/ folder was published on May 7, with six files. For the first time, a diagram contains the ten machines, the three zones, and the bastion host, and nobody drew it. The system fits in the head of whoever looks at it again.

And looking at it whole, you can see what weighs. Ten boxes in a single data center, each installed by hand with a 38-step checklist. A database whose handover requires a person to run a 12-to-19-minute runbook. Three services on the same machine, because separating them cost another one. And a note, repeated in six ADRs, from 004 to 009: “to be reviewed when the store moves to a cloud platform.” The campaign is over, the June review is approaching, and the diagram is on the table. It is time to study that move, in the next lesson: “Cloud Platforms.”

© Copyright 2026. All rights reserved