Kubernetes isn't the only orchestrator. Docker Swarm ships with Docker itself, Nomad handles mixed workloads elegantly, ECS is deeply AWS-native, and serverless containers remove ops entirely. This lesson maps the landscape so you can choose the right tool for your context.

1. Docker Swarm

Swarm mode is built directly into the Docker Engine — no extra binaries to install. One command bootstraps a production-ready cluster:

docker swarm init --advertise-addr 192.168.1.10

Core Concepts

  • Manager nodes — maintain cluster state via Raft consensus; schedule tasks
  • Worker nodes — execute containers assigned by managers
  • Services — desired state declaration (image, replicas, ports, update policy)
  • Tasks — individual container instances of a service
  • Overlay networks — multi-host encrypted networking between services

Key Commands

# Create a service with 3 replicas
docker service create --name web --replicas 3 -p 80:80 nginx:alpine

# Scale the service
docker service scale web=5

# Rolling update
docker service update --image nginx:1.25 --update-parallelism 2 --update-delay 10s web

# Inspect cluster
docker node ls

Swarm Architecture

Manager Nodes (Raft Consensus) Worker Nodes Manager 1 (Leader) Raft Store Scheduler API Server Manager 2 Raft Follower Standby Scheduler Manager 3 Raft Follower Standby Scheduler Worker 1 web.1 api.1 cache.1 Worker 2 web.2 api.2 web.3 Worker 3 api.3 cache.2
Operational Simplicity: Swarm's biggest advantage is that it's already part of Docker. No etcd cluster to manage, no kubelet agents, no separate CLI. The trade-off: fewer features, smaller ecosystem, and Docker Inc. has deprioritized it.

2. Swarm vs Kubernetes

Attribute Docker Swarm Kubernetes
Setup complexityOne commandMultiple components (etcd, API server, scheduler, kubelet…)
Learning curveLow — familiar Docker CLISteep — many abstractions (Pods, Deployments, Services, Ingress…)
Auto-scalingManual scaling onlyHPA, VPA, cluster autoscaler
NetworkingBuilt-in overlay + ingress routing meshCNI plugins, service mesh ecosystem
EcosystemSmall, Docker-centricMassive (Helm, operators, CRDs, CNCF projects)
Scaling limits~1,000 nodes practically5,000+ nodes tested
Production adoptionDecliningIndustry standard
Best forSmall teams, simple apps, Docker-native workflowsComplex microservices, multi-team, enterprise

When Swarm makes sense: You have a small team, simple deployment topology, already use Docker Compose, and don't need advanced scheduling, auto-scaling, or a massive plugin ecosystem.

3. HashiCorp Nomad

Nomad is a workload orchestrator — not just for containers. It schedules Docker containers, raw binaries, Java JARs, VMs (QEMU), and more through a unified interface.

Key Differentiators

  • Single binary — one binary for both server and client; trivial to deploy
  • Multi-workload — containers, VMs, batch jobs, system daemons all in one scheduler
  • HashiCorp ecosystem — native integration with Consul (service discovery), Vault (secrets), Terraform (provisioning)
  • Federation — built-in multi-region, multi-datacenter support
  • Simpler model — jobs → task groups → tasks (fewer abstractions than K8s)

Example Job File

job "web" {
  datacenters = ["dc1"]
  type = "service"

  group "app" {
    count = 3

    network {
      port "http" { to = 8080 }
    }

    task "server" {
      driver = "docker"

      config {
        image = "myapp:1.4"
        ports = ["http"]
      }

      resources {
        cpu    = 500
        memory = 256
      }
    }
  }
}

When to choose Nomad: Mixed workloads (not just containers), simplicity-focused ops teams, already invested in HashiCorp tooling, or teams that find K8s overkill but need more than Swarm.

4. Amazon ECS

ECS is AWS's native container orchestrator — deeply integrated with the AWS ecosystem but locked to a single cloud.

Core Concepts

  • Task Definition — like a pod spec: container images, CPU/memory, ports, environment
  • Service — maintains desired count of tasks, handles rolling deploys
  • Cluster — logical grouping of resources
  • Launch Types:
    • EC2 — you manage the instances; more control, more ops burden
    • Fargate — serverless; AWS manages compute; you just define tasks

AWS Integration

  • ALB/NLB — native load balancer target groups
  • CloudWatch — logs and metrics out of the box
  • IAM roles — per-task IAM roles for fine-grained permissions
  • ECR — private registry with vulnerability scanning
  • App Mesh — service mesh integration

When to choose ECS: All-in on AWS, want managed infrastructure without K8s complexity, comfortable with AWS vendor lock-in, small-to-medium service count.

5. Serverless Containers

The newest evolution: push a container image, the platform handles everything else — scaling, networking, TLS, infrastructure.

Platform Cloud Scale to Zero Max Instances Key Feature
Cloud RunGCPYes1,000Request-based billing, instant deploys
FargateAWSNo (min 1 with ECS)ThousandsDeep AWS integration
Container AppsAzureYes300KEDA-based autoscaling, Dapr integration

Cloud Run Example

# Deploy a container to Cloud Run
gcloud run deploy my-service \
  --image gcr.io/my-project/my-app:1.0 \
  --region us-central1 \
  --allow-unauthenticated \
  --max-instances 10 \
  --memory 512Mi

When to choose serverless containers: Event-driven workloads, variable/spiky traffic, no dedicated ops team, cost optimization for low-traffic services, rapid prototyping.

6. Choosing an Orchestrator

Comparison Matrix

Attribute Swarm Kubernetes Nomad ECS Serverless
Setup effort⭐⭐⭐⭐⭐⭐⭐⭐
Feature richness⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Multi-cloudYesYesYesNoNo
Non-container workloadsNoLimitedYesNoNo
Ops burdenLowHigh (self-managed) / Low (managed)Low-MediumLowMinimal
Vendor lock-inNoneNoneNoneHigh (AWS)High
Community/ecosystemSmallMassiveMediumAWS-centricGrowing

Decision Framework

  • Team < 5 engineers, simple app? → Swarm or serverless containers
  • All-in on AWS, want managed? → ECS with Fargate
  • Mixed workloads (containers + VMs + batch)? → Nomad
  • Multi-cloud, complex microservices, large team? → Kubernetes (managed: EKS/GKE/AKS)
  • Event-driven, variable traffic, no ops? → Cloud Run / Container Apps
  • Need maximum ecosystem and portability? → Kubernetes
🏭 Industry Reality: Most companies end up on managed Kubernetes (EKS, GKE, AKS) because it's become the industry standard with the largest ecosystem. But Nomad thrives in companies with mixed workloads (Cloudflare, Roblox, CircleCI), ECS dominates AWS-centric shops that don't need K8s complexity, and serverless containers are rapidly growing for event-driven services. The "best" orchestrator is the one your team can operate reliably.

🧪 Hands-On Task: Docker Swarm in Action

Initialize a Swarm, deploy a service, scale it, and perform a rolling update:

# Step 1: Initialize Swarm mode
docker swarm init

# Step 2: Deploy a service with 3 replicas
docker service create \
  --name webapp \
  --replicas 3 \
  --publish 8080:80 \
  --update-delay 10s \
  --update-parallelism 1 \
  nginx:1.24-alpine

# Step 3: Verify the service
docker service ls
docker service ps webapp

# Step 4: Scale to 5 replicas
docker service scale webapp=5

# Step 5: Verify scaling
docker service ps webapp

# Step 6: Perform a rolling update
docker service update \
  --image nginx:1.25-alpine \
  --update-parallelism 2 \
  --update-delay 5s \
  webapp

# Step 7: Watch the update progress
docker service ps webapp

# Step 8: Rollback if needed
docker service rollback webapp

# Cleanup
docker service rm webapp
docker swarm leave --force

What to observe: Tasks are spread across nodes (or a single node in dev). During rolling updates, old tasks shut down one-by-one as new ones start. The --update-parallelism and --update-delay flags control update speed.

🧠 Knowledge Check

📝 Key Takeaways

  • Docker Swarm is the simplest orchestrator — built into Docker, one command to start — but has limited features and declining adoption
  • Kubernetes is the industry standard with the largest ecosystem, but carries operational complexity (mitigated by managed offerings)
  • Nomad uniquely handles mixed workloads (containers + VMs + binaries) with operational simplicity and HashiCorp ecosystem integration
  • ECS is excellent for AWS-centric teams wanting managed container orchestration without K8s overhead
  • Serverless containers eliminate ops entirely — ideal for event-driven, variable-traffic services
  • The "best" orchestrator depends on team size, cloud strategy, workload types, and operational expertise — not hype