DevOps
Zero-Downtime Deployments, Explained
Rolling, blue-green, and canary deployment strategies compared — plus the database migration discipline that makes any zero downtime deployment strategy actually work.
By AI Production Partner · · 3 min read
Why deploys cause downtime
The naive deploy stops the old version and starts the new one — dropping every in-flight request and going dark for however long startup takes, with no path back but panic if the new version is broken. Zero-downtime strategies all follow one principle: run old and new side by side, shift traffic gradually, and keep the old version ready until the new one proves healthy.
The three strategies
Rolling replaces instances one at a time behind a load balancer — the default, cheap and adequate for most apps. Blue-green runs a full parallel environment and switches traffic atomically — instant rollback at doubled infrastructure cost during deploys. Canary sends a small traffic slice to the new version and watches error rates before promoting — the safest, requiring solid monitoring to be meaningful.
For most AI-built apps we deploy, health-checked rolling deploys plus one-click rollback deliver the right safety-to-complexity ratio. Blue-green and canary earn their cost at higher stakes and traffic.
The part everyone gets wrong: migrations
During any zero-downtime deploy, old and new code briefly share the database — so schema changes must be backward-compatible. The discipline: expand first (add nullable columns, backfill, deploy code that writes both), contract later (remove the old path in a subsequent release). Destructive changes in a single deploy are the most common cause of 'zero-downtime' deploys that took production down.
This is exactly the operational detail AI tools never mention when generating migrations — and one of the first things we fix when building pipelines.