What Swarm is and where it fits
Docker Swarm mode is Docker's built-in orchestrator. It turns a group of Docker hosts into one cluster that keeps services at a desired number of replicas, spreads them across nodes, load-balances traffic to them, rolls out updates, and distributes secrets — all using the compose file format you already know. Few Bangalore teams run Swarm today, but interviewers still ask it to test orchestration fundamentals (desired state, consensus, scheduling, service discovery) and to see whether you can compare it honestly with Kubernetes.
Swarm mode vs "classic Swarm"
- Classic Swarm (2014) was a separate container that pooled Docker hosts. It's long dead.
- Swarm mode (Docker 1.12+, 2016) is built into the Docker Engine via SwarmKit.
docker swarm initturns it on. This is what "Docker Swarm" means today.
Mirantis (which acquired Docker Enterprise) continues to maintain Swarm, and it still ships in every Docker Engine — but the industry standard for orchestration is Kubernetes.
Why learn it
It teaches the same core ideas as Kubernetes in a smaller package:
| Concept | Swarm | Kubernetes |
|---|---|---|
| Cluster brain | Manager nodes (Raft) | Control plane + etcd (Raft) |
| Desired state object | Service | Deployment / DaemonSet |
| Unit of scheduling | Task (one container) | Pod |
| Run on every node | mode: global |
DaemonSet |
| Service discovery | Embedded DNS + VIP | CoreDNS + ClusterIP |
| External exposure | Routing mesh | NodePort / LoadBalancer / Ingress |
| Secrets | Swarm secrets (encrypted in Raft) | Secrets (etcd, encrypt at rest) |
| App definition | Stack (compose file) | Manifests / Helm / Kustomize |