Docker Swarm vs. Kubernetes vs. AWS ECS vs. Cloud Run: Choosing the right runtime behind one control plane

Compare Docker Swarm, Kubernetes, AWS ECS, and Google Cloud Run across ops toil, state, and lock-in—and see why decoupling deploy workflows prevents rewrites.

Half the teams evaluating an internal developer platform spend six weeks debating container runtimes before shipping a single app. One engineer pushes for Kubernetes with custom operators, while another wants Docker Swarm on three VMs so nobody spends Friday debugging etcd quorum.

Teams starting on AWS ECS or Google Cloud Run hit the reverse bind six months later. Managed runtimes take patching off your plate early, though that convenience reverses once you need local persistent disks, raw TCP sockets, or cross-cloud portability—forcing rewrites across CI scripts and repos.

You avoid both traps when developer workflows stop depending on runtime internals. One contract for builds, secrets, and telemetry lets you pick Docker Swarm, Kubernetes, AWS ECS, or Google Cloud Run for today's constraints instead of guessing next year's org chart.

How do Docker Swarm, Kubernetes, AWS ECS, and Cloud Run compare?

Putting all four runtimes side by side settles much of that debate early. Compare control planes, config surface, state, TCP routing, and portability below.

Container runtime Control-plane model Config surface Stateful volumes & raw TCP Portability
Docker Swarm Raft built into Docker Engine Socket, SSH, or mTLS plus gossip ports and reverse proxy Node-local volumes and raw TCP built in High across any Linux VM or server
Kubernetes (EKS, GKE, AKS, k3s) External API server, scheduler, controllers, etcd YAML, Helm charts, CNI/CSI, kubeconfig or tokens PVCs via CSI; L4 TCP via LoadBalancer, NodePort, or TCPRoute High at API layer; IAM and ingress diverge
AWS ECS (Fargate / EC2) Proprietary AWS control plane Task JSON, executionRoleArn & taskRoleArn, ALB/NLB Amazon EFS and EBS mounts; raw TCP via NLB Low; AWS-bound (ECS Anywhere for own nodes)
Google Cloud Run Serverless GCP HTTP and worker runtime Revisions, GCP IAM accounts, Artifact Registry Ephemeral disk plus GCS FUSE / NFS; no local disks or inbound TCP OCI containers port; GCP IAM and triggers diverge

Columns three and four explain why teams hit software limits long before they exhaust CPU or RAM—whether Helm ceremony on Kubernetes or missing disks and inbound TCP on Cloud Run. Those limits trace back to how each runtime divides its control plane from worker nodes, mapped out in the sketch below.

Four-runtime taxonomy comparing Docker Swarm, Kubernetes, AWS ECS, and Google Cloud Run control planes, config, strengths, and limits

Read the Key limit block inside each column above. Docker Swarm embeds Raft inside Docker Engine to skip external managers, while Kubernetes splits API, scheduler, and state into dedicated processes for cluster policy. AWS ECS and Google Cloud Run push control-plane upkeep onto the cloud provider, trading portability for managed primitives.

In practice, teams hit the first fork early: do you actually need Kubernetes yet, or will Docker Swarm cover everything you ship?

When should you run Docker Swarm instead of Kubernetes?

Teams running five to fifteen services across one to twenty nodes rarely need custom Kubernetes CRDs—whether a seed startup or an autonomous squad inside a larger company. Most of those workloads come down to a web API, background workers, Redis, a database, and cron jobs.

For that footprint, Docker Swarm schedules containers across bare metal or cloud VMs with minimal memory overhead. Nodes pull standard OCI images over private overlay networking once VPC ports (2377/tcp management, 7946/tcp+udp gossip, 4789/udp VXLAN) stay open, and Traefik or Caddy handles Let's Encrypt TLS automatically.

Watch one storage rule early: Swarm's built-in volumes stay local to one node's disk unless you add shared storage underneath. Pin stateful containers onto a chosen host, or keep durable state inside a managed database.

Once Swarm runs in production, two operational habits keep rollouts boring:

  1. Pin SSH host keys explicitly on every node. Enforce StrictHostKeyChecking=yes against stored known_hosts fingerprints so automation stops immediately if a host key shifts.
  2. Verify worker-to-registry reachability and token freshness before deploys. Swarm passes pull credentials via --with-registry-auth, so rollout pull errors usually trace to VPC firewalls, missing CA trusts, or expired ECR and Artifact Registry tokens.

Even at its best, Swarm is explicit about its ceiling. It omits CRDs, namespace quota policies, and native horizontal pod autoscaling. Cross into dozens of services needing strict admission rules or custom operators, and Kubernetes starts earning its overhead.

Where does Kubernetes justify its operational overhead?

Kubernetes attracts loud debate, yet the practical test comes down to two questions. Do your services need cluster primitives such as CustomResourceDefinitions, pod network policies, or GPU autoscalers? And do you have dedicated engineers to keep cluster upgrades current?

Managed services like Amazon EKS, Google GKE, and Azure AKS run the high-availability control plane rather than merely backing up etcd. Billing still depends on cluster tier ($0.10/hour on EKS and paid GKE or AKS tiers, though GKE grants one zonal credit and AKS keeps a free non-SLA tier). Even then, your team owns worker upgrades, IAM bindings (IRSA or EKS Pod Identity on AWS, Workload Identity on GCP), CNI/CSI add-ons, and Helm drift.

Raw TCP streams also bypass standard HTTP Ingress, requiring LoadBalancer, NodePort, or Gateway API TCPRoute. Self-managed k3s cuts weight on private hosts while leaving kubeconfig rotation and API deprecations with operators. Kubernetes pays that back once a platform group builds paved roads on top—because without those internal abstractions, every feature squad shares cluster debugging.

Still, plenty of teams decide to skip cluster nodes altogether.

When do AWS ECS and Google Cloud Run win?

Running AWS ECS or Google Cloud Run takes node patching off your week. That relief is why funded teams graduate off hosted PaaS billing onto cloud credits without hiring an SRE first.

Inside AWS, AWS ECS runs Fargate tasks or EC2 instances in your VPC alongside Amazon ECR and ALBs or NLBs. Task definitions separate executionRoleArn (agent pulls and CloudWatch logs) from taskRoleArn (app AWS API calls). HTTP APIs and private workers sit right beside RDS and SQS with Amazon EFS and Amazon EBS mounts, though ECS's API stays AWS-bound outside AWS ECS Anywhere.

On GCP, Google Cloud Run narrows operational surface further for request- and event-driven workloads. Paired with Google Artifact Registry and GCP IAM, it scales HTTP or gRPC revisions to zero while supporting Cloud Run Jobs, Worker Pools, and GCS FUSE or Managed NFS mounts. Setting min-instances >= 1 eliminates cold starts on latency routes—though local disks stay ephemeral, inbound raw TCP is unsupported, and request-based billing throttles idle CPU.

Compare the native objects needed to ship one TLS HTTPS service with secrets across all four runtimes:

Google Cloud Run (2 objects) : Service/Revision YAML + GCP IAM service account (TLS built in)
Docker Swarm     (3 objects) : Swarm stack + overlay network + reverse proxy (Traefik/Caddy TLS)
AWS ECS          (5 objects) : Cluster + task JSON + execution/task IAM roles + ALB/target group
Kubernetes      (6+ objects) : Deployment + Service + Ingress + Secret + RBAC + CNI/CSI add-ons

To see how those moving parts map onto workload capabilities, the matrix below sets native object counts on the left beside four built-in features on the right.

Chart comparing native moving parts per HTTPS service against built-in volumes, raw TCP, scale-to-zero, and Linux VM capabilities across Cloud Run, Swarm, ECS, and Kubernetes

Compare row one (Cloud Run) against row four (Kubernetes) above. Shrinking six-plus Kubernetes objects down to two Cloud Run resources cuts setup overhead fast, while trading away local block disks and inbound TCP. Docker Swarm and AWS ECS hold balanced middle ground for stateful workers and TCP protocols.

Matrices only tell half the story. Real teams draw these boundaries differently based on staffing and compliance.

Two-team contrast: how do real teams match runtimes to constraints?

Runtime choices go wrong when teams copy another organization's architecture instead of matching their own staffing. Consider how two realistic engineering groups allocate workloads today.

Picture a twelve-engineer startup holding fresh AWS Activate credits and zero SRE staff. They run public HTTP APIs on serverless AWS ECS (Fargate) so credits absorb compute spend, while stateful Redis queues and background workers sit on a three-node Docker Swarm cluster for fast deploys and low overhead.

Now contrast that with a sixty-engineer fintech company backed by a three-person platform team. Compliance audits require pod network policies, OPA admission gates, and autoscaled GPU pools on Amazon EKS, so their platform group standardizes every service onto Kubernetes templates.

Either way, the trap stays identical: locking repo configs to one runtime. Once that twelve-person team hardcodes ECS JSON and CloudWatch forwarders across every repo, switching to bare metal or EKS later forces a painful rewrite.

How does decoupling the developer control plane prevent migration lock-in?

Growing companies shift infrastructure every couple of years—from Linux VMs to AWS ECS on credits, webhooks onto Google Cloud Run, or EKS for enterprise buyers. When repositories bake CI bash scripts, Helm values, ECS JSON, and vendor log forwarders straight into pipelines, switching runtimes stalls product delivery for a quarter. Putting a shared developer control plane in front keeps builds, secrets, and traces intact (Portal vs. PaaS vs. executable IDP).

The system map below shows how that middle contract insulates developer workflows from underlying scheduler APIs.

Control-plane abstraction diagram connecting developer Git pushes and /mcp tools through sealed credentials and capability checks to Swarm, Kubernetes, ECS, and Cloud Run

Notice how little the left box depends on the right box above. Engineers push Git commits, manage shared config, and inspect issues over /mcp, while the middle layer handles sealed secrets, capability checks, and runtime scheduling across Swarm, Kubernetes, ECS, or Cloud Run.

Formatio implements this decoupled contract across all four container runtimes without spilling credentials into repo CI.

First, admins keep infrastructure secrets encrypted with AES-256-GCM under Admin › Inventory › Credentials, never returning plaintext, and pair runtimes with OCI, Amazon ECR, or Google Artifact Registry inside Admin › Platforms (platforms, runtimes, and registries). Swarm connects via SshKey fingerprint pins (KeyPending to Reachable, halting on KeyChanged), DockerTls, or the local socket. Kubernetes uses Kubeconfig or KubernetesToken, ECS takes AwsRole plus ExternalId or AwsAccessKey, and Cloud Run uses GcpServiceAccount (hosts and credentials inventory).

Second, project switching and pre-deploy checks work as separate safeguards. Calling PATCH /api/project/{id}/platform/ reassigns an empty project (with zero applications) to another enabled runtime without touching pipelines. Before any deploy builds, PlatformFit validates declared needs against target capabilities. Hard gaps on volumes, raw TCP routes, or single-replica scheduling fail before compiling, while missing shell access hides only the Terminal tab. Tracked platform states (Pending, Ready, Degraded, Unreachable, Disabled) also stop releases if a runtime goes offline.

Third, builds and OpenTelemetry instrumentation travel inside the container instead of host vendor collectors. Supported Railpack builds auto-instrument Go, Node.js 18.19+ (excluding Bun), Python 3.10+, Java, and .NET 8+ inside /opt/formatio during compilation. Dockerfiles, Nixpacks, Next.js 15+, and Fastify attach a thin 2–3 line SDK hook or standard runtime agent instead, shipping http/protobuf OTLP spans directly (tracing setup and SDKs). Every runtime sends OTLP with zero collector sidecars—keeping serverless ECS and Cloud Run free of node daemons while multi-node Swarm runs lightweight node agents.

How should your team pick its first runtime this week?

Pick the container runtime that fits this quarter's workloads while keeping your developer contract portable:

  1. Pick Docker Swarm on Hetzner, DigitalOcean, bare-metal servers, or cloud VMs when you want multi-node deploys, node-local persistent volumes, and raw TCP with low overhead.
  2. Pick AWS ECS when AWS cloud credits pay your bill and long-running APIs or workers fit inside existing VPC subnets, IAM roles, and EFS or EBS mounts.
  3. Pick Google Cloud Run for bursty HTTP APIs, webhooks, background jobs, and staging apps that benefit from scale-to-zero billing without local block disks.
  4. Pick Kubernetes (EKS, GKE, AKS, k3s) when compliance audits, custom CRDs, GPU autoscaling, or an existing cluster roster already require the Kubernetes API.

Want to inspect multi-runtime workflows and OpenTelemetry traces before provisioning servers? Check our platforms, runtimes, and registries guide, or connect Swarm, Kubernetes, ECS, and Cloud Run under a 14-day free trial.

Frequently asked questions

When does Docker Swarm make more sense than Kubernetes?

Docker Swarm fits best when a 1-to-20-node team needs multi-host clustering, raw TCP routes, and persistent node-local volumes without running an external API server, etcd, CNI plugins, or CRD upgrades. Lightweight open-source deployers such as Dokploy or CapRover suit simple Swarm clusters (whereas Coolify deprecated Swarm for standalone Docker), while larger platform teams needing cluster-wide policy automation still belong on Kubernetes.

Why does migrating between Swarm, ECS, Cloud Run, and Kubernetes usually stall teams?

Migrations stall because teams bake CI scripts, secret handling, log agents, and Helm or ECS JSON straight into every app repo. Keeping Git builds, encrypted env vars, and OTLP config inside Formatio lets PATCH /api/project/{id}/platform/ move empty projects safely, while pre-deploy PlatformFit guards verify volumes, raw TCP routes, and replica caps (platforms, runtimes, and registries).

Does OpenTelemetry tracing change across Swarm, Kubernetes, AWS ECS, and Google Cloud Run?

No—application-layer OpenTelemetry stays consistent across all four runtimes because instrumentation lives inside each container rather than host vendor sidecars. Go compile-time builds, Node.js or Python preloads, Java and .NET runtime agents, and 2–3 line SDK hooks all emit standard http/protobuf OTLP spans. Injected OTEL_* variables stamp every trace with service.version and deployment ID automatically (tracing setup and SDKs).