Skip to content
Tutorials Center
My learning

Topics

Lesson 23 of 39 ยท Deployment and Packaging

Deployment Diagrams

Learn UML deployment diagrams: nodes, execution environments, artifacts, communication paths and deployment specifications, with a runnable capacity checker.

A deployment diagram answers a question that no other UML diagram does: where does the software run? It maps software artifacts (files such as executables, libraries, configuration files and containers) onto nodes (the hardware or virtual machines that host them) and shows how those nodes are connected.

You draw one when you plan a release, explain an architecture to operations, check that a design fits the hardware, or document a cloud setup. In an era of containers and Kubernetes the same notation applies: a pod is a node, an image is an artifact.

Core notation

Element Notation Example
Node 3D box <<device>> Laptop, <<server>> App Server
Execution environment Nested node with <<execution environment>> JVM, Docker engine, Apache, Kubernetes
Artifact Rectangle with <<artifact>> shop.war, config.yml, app.jar
Deployment Artifact drawn inside a node, or a dashed arrow <<deploy>> shop.war runs on Tomcat
Communication path Solid line between nodes, with a protocol label HTTPS, TCP/5432, AMQP
Manifestation Dashed arrow <<manifest>> from artifact to component shop.war manifests OrderService

A node is a computational resource. A device is a physical node (a phone, a router). An execution environment is a software node that hosts other software, such as an application server. Nodes can nest: a server contains an operating system that contains a Docker engine that contains containers.

flowchart TB
    Client["Browser / Mobile App<br/>device"]
    subgraph Cloud["Cloud region"]
        LB["Load balancer<br/>node"]
        subgraph A["App server 1 (Docker)"]
            W1["shop.jar"]
        end
        subgraph B["App server 2 (Docker)"]
            W2["shop.jar"]
        end
        subgraph DBN["Database server"]
            PG[("PostgreSQL<br/>shop.db")]
        end
    end
    Client -->|"HTTPS"| LB
    LB -->|"HTTP"| W1
    LB -->|"HTTP"| W2
    W1 -->|"TCP 5432"| PG
    W2 -->|"TCP 5432"| PG

Two identical app servers behind a load balancer, one database. The labels on the lines are protocols.

Artifacts and manifestation

An artifact is a physical piece of information produced or used by development: a source file, a binary, a script, a Docker image, a model file. An artifact is not the same as a component. The component OrderService is a logical unit in your design, while order-service-1.4.2.jar is the file that manifests it. Distinguishing the two keeps your model honest: you can change the packaging (one jar or three) without changing the logical architecture.

Deployment specifications

A deployment specification attaches properties to a deployment, for example { cpu = 2, memory = "4GB", replicas = 3 } or the path of a configuration file. In practice you put these values in a note or in a stereotype property. This is where deployment diagrams meet real infrastructure files such as a Kubernetes manifest or Terraform code.

Instances and types

Boxes can be node types (the server design) or node instances (app1 : AppServer, underlined name). Most diagrams mix them. Use instance notation when you must show exactly three replicas, and type notation for the general topology.

Levels of detail

  • Overview: devices and network zones only. Good for managers and security reviews.
  • Logical deployment: nodes, environments and the main artifacts.
  • Detailed: ports, protocols, replicas, versions and resource limits.

Match the level to the question. A diagram that shows everything answers nothing.

Common questions a deployment diagram settles

  1. Where is the single point of failure?
  2. Which network links carry sensitive data and need TLS?
  3. Which environments exist (dev, staging, production) and how do they differ?
  4. How many nodes of each kind are needed to handle the expected load?

The last one can be checked with a few lines of code, which is a good example of how models and calculations support each other.

A deployment model in code

The node tree below is plain data, and a small script can summarize what is deployed and how much memory each server needs.

Python Model nodes and artifacts as data

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Finding a single point of failure

If removing one node disconnects the client from the data, that node is a single point of failure. The script tries removing each node in turn.

Python Which node, if lost, breaks the system?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The load balancer shows up (the database is the destination, so it is excluded from the loop). The diagram led you to ask the question; the fix (a second load balancer, database replication) is a new deployment diagram.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What does a deployment diagram primarily show?

    It maps artifacts to nodes and communication paths.
  2. 2. What is the relationship between a component and an artifact?

    A component is logical; an artifact such as a jar or image is the physical file that manifests it.
  3. 3. A Docker engine running on a server and hosting containers is best drawn as:

    Execution environments are software nodes that host other software.
  4. 4. What do labels on communication paths usually contain?

    Protocols tell reviewers which links need security and monitoring.

Summary

  • Deployment diagrams map artifacts onto nodes and show the paths between nodes.
  • Nodes can be devices or execution environments, and they nest.
  • An artifact manifests a component; keep logical and physical views apart.
  • Deployment specifications record properties such as memory, replicas and config.
  • Use the diagram to spot single points of failure, security boundaries and capacity limits.

Next: Package Diagrams and Dependencies