Archyno
UMLDiagramas de estructura

Ejemplos de diagramas de despliegue

Tres diagramas de despliegue de sistemas que reconocerá - una aplicación web de tres capas, un clúster de Kubernetes y un pool tras un balanceador - cada uno con el razonamiento de qué se dibujó y qué se dejó fuera a propósito.

8 min de lecturaUML 2.5.122 de 35

HTTPSHTTP/8080TCP/5432«deploy»«deploy»«deploy»web-ui.tar.gzorders.jarschema.sql«device»Browser«execution environment»nginx«execution environment»app-01«device»postgres
The three-tier stack: four nodes, three protocols, three artifacts. Most first deployment diagrams are this diagram with different names.

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.

HTTPSHTTP/8080TCP/5432«deploy»«deploy»«deploy»ingress.yamlorders:1.4.2schema.sql«device»ALB«execution environment»ingress-nginx«execution environment»orders pod«device»orders-db

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.

«device»haproxy«execution environment»app-01«execution environment»app-02«execution environment»app-03«device»db-primary

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

  1. 01Four nodes, labelled protocols and named artifacts is already a complete deployment diagram.
  2. 02A running container is a node; the image it started from is an artifact. Confusing the two is the usual container mistake.
  3. 03Protocol and port labels are what make the diagram worth opening in a review.
  4. 04Draw one instance per role and use a multiplicity when the count varies at runtime.
  5. 05If a box cannot be pinged, it does not belong on this diagram.

06Preguntas frecuentes

¿Cuál es un ejemplo sencillo de diagrama de despliegue?

Un navegador que se conecta a un servidor web, este a un servidor de aplicaciones y este a una base de datos, con un artefacto desplegado en cada uno. Cuatro nodos, tres caminos de comunicación etiquetados con su protocolo y tres flechas de despliegue forman un diagrama completo y útil.

¿Cómo se dibuja un diagrama de despliegue para Kubernetes?

Modele las piezas de ejecución del clúster como nodos y las imágenes como artefactos. El balanceador es un dispositivo, el controlador de ingress y cada pod son entornos de ejecución, y la imagen del contenedor es un artefacto desplegado en el pod. Los servicios gestionados siguen siendo dispositivos en el borde.

¿Los contenedores son nodos o artefactos en UML?

Ambos, según a qué contenedor se refiera. Un contenedor en ejecución es un entorno de ejecución y por tanto un nodo, porque dentro corre otra cosa. La imagen de la que arrancó es un artefacto, porque es un archivo producido por una compilación. Dibujar la imagen como nodo es el error más común.

¿Cómo se muestra la redundancia en un diagrama de despliegue?

O dibuja las instancias, que es honesto pero no aguanta más de cuatro, o dibuja un nodo con una multiplicidad en la esquina, por ejemplo app-node con 3..*. Use lo segundo cuando el número varíe en ejecución: un diagrama que afirma exactamente tres es falso tras el primer autoescalado.

¿Cuánto detalle debe llevar un diagrama de despliegue?

El suficiente para responder a la pregunta que le hizo dibujarlo. Una revisión de infraestructura quiere protocolos y puertos en los caminos de comunicación; un diagrama de incorporación quiere cuatro cajas y nada más. Cada nodo extra es una afirmación que alguien deberá mantener cierta tras la próxima migración.

Todos los artículos