# Docker Swarm vs Docker Cluster

How Docker Swarm turns several linked computers into one pool of containers, with managers that plan the work and workers that run it, and how that differs from a general cluster\.

By gentle\-finch\-e1b1c494

Topic: Computing, AI &amp; Electronics

[Open the interactive Jig](https://ask.jig.com/j/I5WbF7GQNUzu)

## Transcript

### 1. Boxes for software

A container is a sealed box that holds an app and everything it needs, so it runs the same on any computer\. Docker is the tool that builds and runs these boxes\. Here one computer is running three of them\.

Drag anywhere to turn the model and look around\.

### 2. A cluster is a team

When one computer is not enough, we link several together over a network\. A group of computers working together as one system is called a cluster\. "Cluster" is a general word, not a Docker product, and just plugging computers together does not share out the work\.

### 3. Swarm is Docker's team captain

Docker Swarm, also called swarm mode, is built into Docker\. It turns a cluster of Docker computers into one shared pool and spreads the containers out\. So a swarm is a kind of cluster: the one Docker organises itself\.

Swarm mode has been part of Docker Engine since version 1\.12\.

### 4. Managers and workers

Each computer in a swarm is called a node\. Manager nodes, with gold lights, plan the work and remember it\. Worker nodes, with blue lights, run the containers\. One manager is the leader, marked by the floating gem\.

Managers can run containers too, unless you tell them not to\.

### 5. Ask for copies

You tell the swarm a service: which app to run and how many copies\. Each copy is a task, one running container\. Choose a number and watch the managers spread the copies across the nodes\.

### 6. It heals itself

The swarm keeps checking that what is running matches what you asked for\. If a worker stops, its tasks are started again on healthy nodes, so the count stays the same\. Unplug a worker, or click one, to see it happen\.

When a node comes back, the swarm does not move running tasks back by itself\.

### 7. Any door works

Visitors can knock on any node, even one that is not running the app\. The swarm's routing mesh passes each request along to a node that is\. Watch the bright requests find their way\.

### 8. Managers vote

Managers agree on the plan by voting, using a method called Raft\. More than half must agree, so three managers can lose one and keep going, and five can lose two\. Watch the leader switch off and the others choose a new leader\.

Containers that are already running keep running even if too many managers are lost\.

### 9. Swarm vs cluster

A cluster is any team of computers working as one\. A swarm is a cluster that Docker builds and manages with its own built\-in tools\. Other tools, like Kubernetes, build clusters too: they do more, but they are bigger and harder to learn\.
