If your deployment process involves a maintenance page, a 2 AM window, or a Slack message saying "don't push to main for the next hour" — your deployment process is broken.

Zero-downtime deployment isn't a luxury. It's a requirement for any production system that users rely on. And it's simpler to achieve than most teams think.

This guide covers the three main strategies, when to use each, and the hardest part that nobody talks about — database migrations.

The Three Deployment Strategies

Every zero-downtime deployment uses one of these three patterns. Each has different trade-offs in complexity, cost, and risk.

1. Blue-Green Deployment

The simplest and most reliable strategy. Two identical environments. One serves traffic (Blue), one sits idle (Green).

  1. Deploy the new version to Green
  2. Run automated health checks and smoke tests against Green
  3. Switch the load balancer to point to Green
  4. Green is now live. Blue is the instant rollback target.
  5. After a safety period (15–30 minutes), tear down Blue or keep it for the next deployment

Rollback time: Under 30 seconds (just switch the load balancer back)

Best for: Most applications. Especially good when you need guaranteed instant rollback. Our default recommendation.

Trade-off: Requires double the infrastructure during deployment (but only for 15–30 minutes). With containers on Fargate, the extra cost is negligible.

"We've done over 200 blue-green deployments for clients. Zero have caused user-facing downtime. The strategy is boring — and that's exactly why it works."

2. Canary Deployment

Deploy the new version to a small percentage of your fleet first. Monitor closely. If everything looks good, gradually increase to 100%.

  1. Deploy the new version to 5% of instances/containers
  2. Monitor error rates, latency, and business metrics for 10–15 minutes
  3. If metrics are healthy, increase to 25%, then 50%, then 100%
  4. If anything looks wrong at any stage, roll back the canary instances immediately

Rollback time: 1–2 minutes (terminate canary instances, traffic returns to old version)

Best for: High-traffic applications where a bug in the new version would affect millions of users. The blast radius of a canary failure is limited to 5% of traffic.

Trade-off: More complex to set up. Requires good monitoring to detect issues in the canary. You need to handle running two versions simultaneously (API compatibility).

3. Rolling Update

Replace instances one at a time (or in small batches). The simplest to configure but the least controllable.

  1. Take one instance out of the load balancer
  2. Update it with the new version
  3. Run health checks. If it passes, put it back in the load balancer.
  4. Repeat for the next instance until all instances are updated

Rollback time: Slow — you have to roll forward or reverse the entire process

Best for: Non-critical services, internal tools, or when infrastructure cost is a hard constraint

Trade-off: During the rollout, users are hitting both old and new versions simultaneously. Rollback is slow and messy. Not recommended for critical user-facing services.

Which Strategy Should You Use?

Decision Matrix

Small team, simple app, need fast rollback → Blue-Green. Start here. It covers 90% of use cases.


High-traffic, millions of users, risk-sensitive → Canary. Limit blast radius to a small percentage of traffic.


Internal tools, low-risk services → Rolling Update. Simple and cost-effective.


Not sure? → Blue-Green. You can always add canary later.

The Hard Part: Zero-Downtime Database Migrations

Here's the truth nobody mentions in deployment tutorials: the application deployment is the easy part. The database migration is where things break.

You can't just run ALTER TABLE on a production database during a deployment. Long-running schema changes lock tables. Dropped columns crash the old version. Renamed fields break both versions.

The solution is the expand-contract pattern:

Phase 1: Expand

Phase 2: Migrate

Phase 3: Contract

Yes, it's three deployments instead of one. But each one is safe, reversible, and zero-downtime. The alternative — a single risky migration — is how data gets lost.

"Every production data loss incident we've investigated had the same root cause: a schema change and an application change deployed simultaneously without a rollback plan."

Health Checks: The Deployment Safety Net

Your deployment strategy is only as good as your health checks. If the load balancer can't tell whether the new version is healthy, it can't protect your users.

Three levels of health checks:

  1. Liveness check: Is the process running? (TCP connection succeeds) — prevents routing to crashed containers
  2. Readiness check: Is the application ready to serve traffic? (HTTP 200 from /health) — prevents routing to instances still starting up
  3. Deep health check: Can the application actually do useful work? (Database connected, cache reachable, external APIs responding) — catches "running but broken" scenarios

Configure your load balancer to use the readiness check for routing decisions. Use the deep health check for your deployment pipeline's go/no-go decision.

Connection Draining: Don't Drop In-Flight Requests

When you take an instance out of a load balancer, active requests are still being processed. If you terminate the instance immediately, those requests fail.

Connection draining (also called deregistration delay) tells the load balancer to stop sending NEW requests to the instance but wait for existing requests to complete before removing it.

Rollback: Plan for Failure

Every deployment should have a rollback plan that can execute in under 5 minutes. If you can't roll back quickly, you shouldn't be deploying.

Rollback checklist:

Implementing Zero-Downtime on AWS ECS

Here's the exact setup we use for most clients on AWS:

Total setup time: half a day for someone who's done it before. A week if you're learning as you go.

Monitoring Your Deployments

After every deployment, watch these metrics for 15 minutes:

Automate this. Don't rely on a human watching a dashboard. Set CloudWatch or Datadog alarms that trigger within 2 minutes of anomalous behavior.

Common Mistakes

Ready to Deploy Without Fear?

Zero-downtime deployments aren't about fancy tooling. They're about disciplined engineering practices — health checks, connection draining, expand-contract migrations, and automated rollbacks.

If your team still dreads deployment day, we can help. We'll audit your current deployment process and implement zero-downtime deployments — typically within a week.