Exemples de diagrammes de déploiement
Trois diagrammes de déploiement de systèmes que vous reconnaîtrez - une application web trois tiers, un cluster Kubernetes et un pool derrière un répartiteur de charge - chacun avec la raison de ce qui est dessiné et de ce qui est volontairement omis.
8 min de lectureUML 2.5.122 sur 35
01Example 1: a three-tier web application
The diagram above is the one worth being able to draw from memory. A browser, a web server terminating TLS, an application server, a database. Three communication paths carrying the protocol and port, and three artifacts dropped onto the nodes that run them.
Two decisions in it are worth naming. First, the protocol labels are the reason the diagram is useful: HTTPS, HTTP/8080, TCP/5432 is the entire content of most security reviews, and a diagram without them is four boxes anybody could have guessed. Second, the artifacts are real filenames - orders.jar, not “application” - because a deployment diagram is about physical things, and a build produces files with names.
02Example 2: a Kubernetes cluster
Containers make people hesitate, because a container is both a thing that runs and a thing that was built. UML already separates those: the running container is an execution environment, which is a node, and the image it started from is an artifact, which is deployed onto it.
Nothing about the shape of this diagram differs from the three-tier one, which is the point: the runtime changed and the notation did not. The load balancer is a «device» because it is infrastructure you do not deploy into. The ingress controller and the pod are «execution environment» because other things run inside them. The image tag orders:1.4.2is an artifact because a build produced it, and putting the version in the label is what makes the diagram answer “what is running in production right now”.
The managed database sits at the edge as a plain device. That is the honest drawing: you do not deploy artifacts onto a service somebody else operates, and pretending the schema is installed “onto RDS” is only true in the sense that it was applied there once.
03Example 3: a load-balanced pool
The commonest reason anyone opens a deployment diagram is to find out what happens when one box dies. That question has a shape, and it is worth drawing explicitly rather than leaving it to a footnote.
Three application nodes behind one load balancer, all writing to a single primary. Drawn this way, the single point of failure is visible without anybody having to say it: the app tier fans out and the data tier does not. That is a sentence somebody will act on, and it took no extra notation to make.
When the count varies at runtime, replace the three nodes with one carrying a multiplicity - app-node [3..*] - rather than drawing an arbitrary number. A diagram that claims exactly three is false the first time the group scales, and a diagram known to be false stops being consulted.
04What to leave off
Every deployment diagram that becomes useless does so the same way: somebody kept adding nodes. The discipline is deciding what the diagram is for before the second box goes down.
Reach for it when
- Protocols and ports on every communication path - it is the content of most reviews.
- Real artifact names with versions, so the diagram answers what is running now.
- One representative instance per role, with a multiplicity when the count varies.
- Managed services as plain devices at the edge, with the boundary of what you operate visible.
Reach for something else when
- Logical layers - they have no address and nothing is deployed onto them.
- Every microservice in a large estate. Draw one subsystem per diagram instead.
- Monitoring, logging and CI agents, unless the diagram is about them.
- Live instance counts, which are wrong by the time the diagram is reviewed.
If you need the counterpart that shows the software rather than the machines, that is a component diagram. The two are usually drawn as a pair, and the deployment one is the shorter of them.
05What to remember
In one line each
- 01Four nodes, labelled protocols and named artifacts is already a complete deployment diagram.
- 02A running container is a node; the image it started from is an artifact. Confusing the two is the usual container mistake.
- 03Protocol and port labels are what make the diagram worth opening in a review.
- 04Draw one instance per role and use a multiplicity when the count varies at runtime.
- 05If a box cannot be pinged, it does not belong on this diagram.
06Questions fréquentes
Quel est un exemple simple de diagramme de déploiement ?
Un navigateur qui se connecte à un serveur web, celui-ci à un serveur d'application, et celui-ci à une base de données, avec un artefact déployé sur chacun. Quatre nœuds, trois chemins de communication étiquetés par protocole et trois flèches de déploiement font un diagramme complet et utile.
Comment dessiner un diagramme de déploiement pour Kubernetes ?
Modélisez les éléments d'exécution du cluster en nœuds et les images en artefacts. Le répartiteur de charge est un dispositif, le contrôleur d'ingress et chaque pod sont des environnements d'exécution, et l'image du conteneur est un artefact déployé sur le pod. Les services managés restent des dispositifs en bordure.
Les conteneurs sont-ils des nœuds ou des artefacts en UML ?
Les deux, selon le conteneur dont on parle. Un conteneur en cours d'exécution est un environnement d'exécution, donc un nœud, puisque autre chose y tourne. L'image dont il est issu est un artefact, car c'est un fichier produit par un build. Dessiner l'image en nœud est l'erreur la plus fréquente.
Comment montrer la redondance sur un diagramme de déploiement ?
Soit vous dessinez les instances, ce qui est honnête mais ne tient pas au-delà de quatre, soit vous dessinez un seul nœud avec une multiplicité dans le coin, par exemple app-node en 3..*. Prenez la seconde quand le nombre varie à l'exécution : un diagramme affirmant exactement trois est faux dès le premier autoscaling.
Quel niveau de détail pour un diagramme de déploiement ?
Assez pour répondre à la question qui vous a fait le dessiner. Une revue d'infrastructure veut les protocoles et les ports sur les chemins de communication ; un diagramme d'accueil veut quatre boîtes et rien d'autre. Chaque nœud en plus est une affirmation que quelqu'un devra maintenir vraie après la prochaine migration.
À lire aussi