Deployment diagram

The deployment diagram demonstrates the physical deployment of artifacts on nodes.

For example, to describe a website, a deployment diagram should show which hardware components (“nodes”) exist (for example, a web server, database server, application server), which software components (“artifacts”) work on each node (for example, a web application, a database), and how the various parts of this complex are connected.

The deployment diagram is designed to visualize the elements and components of the program that exist only at the stage of its execution.

In this case, only component-instances of the program that are executable files or dynamic libraries are presented. Those components that are not used at runtime are not shown on the deployment diagram.

When developing deployment diagrams, the following objectives are pursued:

  • determine the distribution of system components by its physical nodes;
  • show the physical connections between all nodes of the system implementation at the stage of its execution;
  • identify system bottlenecks and solve the problems of rational component placement.

1. Basic elements

A node is a physically existing element of a system that has a certain computing resource. 

There are two types of nodes: 

  • Device node 
  • Runtime node 

Device nodes are physical computing resources with their memory and services for executing software (PCs, mobile phones).

A runtime node is a software computing resource that runs inside an external node and which provides a service that runs other executable program elements.

Graphically, the nodes are rectangular parallelepipeds, inside of which the name is indicated.

Nodes can have subnodes that are represented as nested rectangular parallelepipeds. A single deployment diagram node can conceptually represent multiple physical nodes. 

An artifact is a physical entity, a software component that is used or created while the software is running. 

Artifacts are depicted inside nodes. 

Graphically, an artifact is a rectangle with a name. 

Connections

Define relationships between nodes. There are: 

  • physical connections between nodes 
  • dependencies between nodes and components, 

Compounds are a type of association and are represented by line segments without arrows. The presence of such a line indicates the need for a physical channel to exchange information between the respective nodes. The nature of this interaction can be determined using comments and restrictions.

Dependency is a form of connection that shows the relationship of dependency between a node and components deployed on it. This method is an alternative to the embedded image of the components inside the node symbol. Depicted by dashed lines with arrows.

You can use any other elements and types of connections if it is necessary for your task.

2. Syntax 

Elements declaration 

Classic elements of the Deployment Diagram are represented using the nest keywords: node, artifact and component.  

Код скопирован
  • @startuml                           
  • node node 
  • artifact artifact 
  • component component 
  • @enduml 

If your task requires it, you can use all the variety of UML elements: 

Код скопирован
  • @startuml                  
  • actor actor  
  • agent agent  
  • artifact artifact  
  • boundary boundary  
  • card card  
  • cloud cloud  
  • component component  
  • control control  
  • database database  
  • entity entity  
  • file file  
  • folder folder  
  • frame frame  
  • interface interface  
  • node node  
  • package package  
  • queue queue  
  • stack stack  
  • rectangle rectangle  
  • storage storage  
  • usecase usecase  
  • @enduml

You can use curl brackets {} to represent nested artifacts and components

Код скопирован
  • @startuml                           
  • node ec2 {   
  • artifact artifact 
  • component component 
  • @enduml 

Actually, nesting can be organized in several layers:

Код скопирован
  • @startuml
  • cloud {
  • frame frame {
  • node node {
  • stack stack
  • }
  • }
  • actor actor
  • actor actor1
  • }
  • @enduml

Use brackets [ ] to put a text inside the graphical image of the element. 

Код скопирован
  • @startuml                       
  • node node [ 
  • This is a <b>node 
  • —- 
  • You can use separator 
  • ==== 
  • of different kind 
  • …. 
  • and style 
  • artifact artifact [ 
  • This is a <b>artifact 
  • —- 
  • You can use separator 
  • ==== 
  • of different kind 
  • …. 
  • and style 
  • <i><color:blue>(add from V1.2020.7)</color></i> 
  • @enduml 

Dependency declaration

Relationships are declared using standard -- (for a solid line) and .. (for a dashed line). Arrows can be added using the > character.

A colon : is used to create the label. 

In addition to classic types of relationships you also can use others: 

Код скопирован
  • @startuml
  • node node1
  • node node2
  • node node3
  • node node4
  • node node5
  • node1 — node2 : label1
  • node1 .. node3 : label2
  • node1 ~~ node4 : label3
  • node1 == node5
  • node node10
  • node node20
  • node node30
  • node node40
  • node node50
  • node10 <<..> node20
  • node10 #–* node30
  • node10 0–o node40
  • node10 ^–+ node50
  • @enduml

Relationships within an element: 

Код скопирован
  • @startuml
  • cloud {
  • frame frame {
  • node node {
  • stack stack
  • }
  • }
  • actor actor
  • actor actor1
  • actor –> actor1
  • actor1 ..>> node
  • actor ..> frame
  • }
  • @enduml

As a rule, the development of the deployment diagram is carried out at the final stage of the OOAD, which characterizes the end of the design phase of the physical representation.

On the other hand, a deployment diagram can be built to analyze an existing system with a view to its subsequent modification.