Docker Compose vs Nomad: Choosing the Right Orchestrator for a Small SaaS

I’m rolling out the first version of a B2B SaaS that will start with a handful of containers: a Rails API, a Redis cache, a Postgres DB, and a side‑car worker. The team is comfortable with Docker, but we’re debating whether to stick with a simple docker‑compose.yml or move to HashiCorp Nomad for future scaling.

Docker Compose pros

  • Zero‑config on most dev boxes; docker compose up -d works out of the box.
  • Single file keeps the stack visible, easy to version.
  • No extra daemon to manage in production if we run it on a small VM.

Cons

  • No built‑in service discovery beyond static links.
  • Scaling is manual (docker compose up --scale worker=3).
  • No health‑check‑driven restarts beyond Docker’s basic restart policy.

Nomad pros

  • Native support for multi‑region jobs, rolling updates, and auto‑scaling via the scale stanza.
  • Consul integration gives DNS‑based service discovery.
  • Scheduler is lightweight; can run on the same node as the containers.

Cons

  • Requires a Nomad server (even a single‑node dev mode adds a process).
  • HCL syntax is a step up from YAML for newcomers.
  • Slightly higher ops overhead for TLS certs and ACLs.

A minimal docker-compose.yml example:

services:
  api:
    image: myorg/api:latest
    ports: ["8000:8000"]
    depends_on: [db, redis]
  db:
    image: postgres:15
    volumes: ["db-data:/var/lib/postgresql/data"]
  redis:
    image: redis:7
volumes:
  db-data:

And a comparable Nomad job snippet:

job "saas" {
  datacenters = ["dc1"]
  group "web" {
    task "api" {
      driver = "docker"
      config {
        image = "myorg/api:latest"
        ports = ["http"]
      }
      resources { cpu = 500; memory = 256 }
    }
    task "redis" { driver = "docker" config { image = "redis:7" } }
    task "db"    { driver = "docker" config { image = "postgres:15" } }
    network { port "http" { static = 8000 } }
  }
}

Questions for the community

  1. In a production environment that will eventually need auto‑scaling, how much extra operational cost did you see when moving from Compose to Nomad?
  2. Have you run Nomad on a single‑node VM for a SaaS launch and later expanded to a cluster without service disruption?
    Your real‑world experiences will help decide if the upfront complexity of Nomad is worth it for a small but growing product.
DevOps#DevOps#SaaS
0

0 Answers

Post Your Answer

Use ``` code ``` for syntax highlighting