Creating system architecture design diagrams is an important part of technical documentation. As system complexity grows, clarity within teams becomes even more important.
But creating diagrams from scratch using canvas-like tools isn't always efficient.
Luckily, there's an alternative way to create diagrams using a diagram-as- code approach. In this approach, you explain the diagram components using a predefined syntax instead of drawing them.
Table of Contents

How to Connect Nodes and Data Flow

Changes are tracked via version control.

Saves time as drawing from scratch or a tool takes time due to manual formatting.

Most diagram-as-a-code tools support standard tech icons like database, storage bucket, load balancers, and so on.

Diagrams can be generated automatically in CI/CD pipelines or documentation builds using code.

Prerequisites and Installation
In this tutorial, you'll learn how to draw diagrams using the Python Diagrams library. The basic prerequisites are:

pip for installing Python packages

Graphviz installed on your operating system for rendering output images

The Python package:
pip install diagrams

A terminal to run files like:
python diagram.py

What is Diagrams?
Diagrams is a Python library that lets you draw cloud system architecture in Python code. It supports different providers like Azure, GCP, AWS, and so on.
By the end of this tutorial, you'll be able to understand how this diagram was made: