Zero-Downtime Blue/Green Deployments
Reusable production assets included1 downloadable template · MIT licensed
View resources

Practical guide scope

Who this is for

Release engineers, SREs, backend leads, and SaaS teams with customer-facing deploys

Where it applies

Web applications and APIs behind Nginx, HAProxy, Kubernetes Services, ingress controllers, or cloud load balancers

Problems this guide helps solve

  • Deployments require an outage or risky in-place restart.
  • Teams switch traffic before validating real dependencies.
  • Rollback is slow because old and new versions are not simultaneously available.
  • Database migrations turn application rollback into disaster recovery.

Zero-downtime deployment is not a marketing phrase. It is an operating model for releasing production changes without turning every deploy into a user-visible outage. The Blue/Green pattern is one of the clearest ways to do it: keep the current version stable, deploy the candidate version beside it, validate it, shift traffic, and keep rollback simple.

For SteadyOps, the goal is not only “the page stayed up.” A production release is safe when the team can prove that the new version is healthy, observe p95/p99 latency during the switch, stop the rollout quickly, and return traffic to the previous version without guessing.

What Blue/Green deployment really means

In a Blue/Green deployment, Blue is the currently serving environment and Green is the candidate environment. Both should be production-like: same configuration model, same secrets injection process, same database compatibility expectations, same monitoring, and the same external dependencies where possible.

The pattern fails when Green is treated as a demo environment. If Green has different resources, missing observability, untested migrations, or incomplete dependency access, the traffic switch becomes a production experiment.

A good Blue/Green deployment answers these questions before traffic moves:

  • Is Green running the exact artifact expected for the release?
  • Are readiness and health checks meaningful?
  • Are database migrations backward compatible?
  • Are queues, cron jobs, and workers safe to run in parallel?
  • Can we switch traffic back to Blue immediately?
  • Are dashboards and alerts tagged by version?

Pre-release checklist

The safest deployment is the one that can be stopped early. Before the switch, validate the candidate with smoke tests, dependency checks, and operational signals.

curl -fsS https://green.example.com/health
curl -fsS https://green.example.com/api/health
kubectl rollout status deployment/app-green -n production
kubectl logs -n production deploy/app-green --tail=100

For Kubernetes, do not rely only on “pods are running.” A pod can be Running while the application cannot reach PostgreSQL, Redis, RabbitMQ, Keycloak, or an external API. Readiness checks must verify real dependencies or at least fail safely when the service cannot process requests.

For VM or bare-metal setups behind Nginx/HAProxy, validate backend health directly and through the load balancer. The release is not ready until the same path users will hit has passed checks.

Database migration safety

Most zero-downtime failures are database failures disguised as deployment failures. Application code can be rolled back quickly, but destructive schema changes can make rollback impossible.

Use expand-and-contract migrations:

  1. Add new nullable columns or new tables.
  2. Deploy code that writes both old and new paths if needed.
  3. Backfill data safely.
  4. Switch reads to the new structure.
  5. Remove old structures only after the previous version is no longer needed.

Avoid deploying code that requires an irreversible migration at the same moment traffic is switched. If rollback requires restoring a database backup, the deployment is not zero-downtime. It is a high-risk release.

Traffic switching and rollback criteria

Traffic switching should be boring. Whether you use DNS, Nginx, HAProxy, Kubernetes Service selectors, Argo Rollouts, or a cloud load balancer, the rollback path must be known before the deployment starts.

Good rollback criteria are objective:

  • 5xx rate increases above agreed threshold.
  • p99 latency grows for critical endpoints.
  • queue depth starts rising.
  • PostgreSQL connection count spikes.
  • error logs show repeated dependency failures.
  • business smoke test fails.

A simple SRE rule: if the team has to debate whether rollback is allowed, the release plan is incomplete.

Observability during the release

Zero-downtime deployment requires release-aware observability. Dashboards should show version, environment, traffic share, error rate, latency, saturation, and dependency health. Logs should include release version or commit SHA.

Useful release checks:

kubectl get deploy -n production -o wide
kubectl describe hpa -n production app
kubectl top pods -n production
curl -s https://service.example.com/version

For APIs, watch RED metrics: rate, errors, duration. For infrastructure, watch USE metrics: utilization, saturation, errors. For databases, watch locks, slow queries, active connections, and replication lag. A deployment that looks healthy at the web layer can still overload the database.

Decision matrix

ApproachBest forStability impactComplexity
Manual deploy + manual rollbackSmall internal toolsBetter than uncontrolled changes, but slow under pressureLow
Blue/Green with load balancer switchWeb apps and APIsStrong rollback path and clear validation pointMedium
Canary releaseHigh-traffic servicesReduces blast radius with gradual exposureMedium/High
Argo Rollouts / automated analysisKubernetes platformsAutomates progressive delivery with metricsHigh
Feature flags + Blue/GreenProduct changes with risk separationDecouples deployment from feature exposureHigh

Key takeaways

  • Zero-downtime deployment means validated release safety, not only avoiding a restart.
  • Blue/Green works when both environments are production-like and observable.
  • Database migrations must preserve rollback paths.
  • Rollback criteria should be objective and agreed before traffic moves.
  • The best deployment process makes aborting a bad release fast and boring.

Operational takeaway

Design every production release around the rollback path first. If you can switch back safely, measure impact clearly, and validate dependencies before traffic moves, zero-downtime deployment becomes an engineering control instead of hope.

Need safer production releases?

SteadyOps can review your CI/CD pipeline, rollback strategy, health checks, and release observability to build a safer deployment process for production systems.

Implementation blueprint

Use this sequence to turn the theory into an auditable production change. Adjust commands, thresholds, and ownership to the real environment before execution.

  1. Create equivalent blue and green environments

    Use the same artifact model, configuration injection, dependency access, health checks, observability, and capacity assumptions.

    • Artifact SHA is visible
    • Secrets and config are equivalent
    • Green has production-like dependency access
  2. Validate before traffic switch

    Run synthetic transactions, dependency checks, warm-up, migration compatibility, queue and worker checks, and release-aware monitoring.

    • Critical transaction passes
    • Latency is within target
    • Workers are safe to run in parallel
  3. Switch gradually and keep blue intact

    Move a controlled share of traffic where possible, watch objective rollback signals, and do not destroy blue until the observation window ends.

    • Rollback switch is one action
    • Blue remains healthy
    • Observation window is defined

Configuration and command examples

Examples are conservative starting points. Review security, version compatibility, failure behavior, and rollback before production use.

Nginx upstream switch pattern

Keep upstream definitions versioned and validate configuration before reload.

upstream app_active {
    server 127.0.0.1:8082 max_fails=3 fail_timeout=10s;
    keepalive 32;
}

server {
    listen 443 ssl http2;
    server_name app.example.com;

    location / {
        proxy_pass http://app_active;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Request-ID $request_id;
    }
}
  • Run nginx -t before reload.
  • Keep the previous upstream definition ready for immediate rollback.

Production validation checklist

  • Green serves the intended artifact and configuration.
  • Health checks include required dependencies.
  • Critical business transactions pass before and after traffic switch.
  • Error rate, latency, saturation, queue depth, and database connections remain stable.
  • Blue can receive traffic immediately without data incompatibility.
  • The release record contains commit SHA, switch time, signals, and outcome.

Official references

Reusable assets

Download templates and validation files

Use these files as reviewed starting points. Keep the source link and version when sharing or adapting them.

Markdown

Blue/Green release checklist

Traffic switch, migration safety, smoke validation, rollback trigger, and cleanup checks.

Download →

Templates are provided under the MIT License. Production use still requires environment-specific review and testing.

Stable reference

Version, testing scope, and citation

Version
1.0.0
Last reviewed
Jul 10, 2026
Tested with
Kubernetes Services · NGINX/HAProxy · Helm 3 · GitHub Actions/GitLab CI
License
CC BY 4.0 for the article; MIT for downloadable templates
Yuri Osipov. "SteadyOps Zero-Downtime Deployment Checklist." SteadyOps, version 1.0.0, reviewed 2026-07-10. https://steadyops.best/articles/zero-downtime-bluegreen-deployments/

Deployment safety review

Need a zero-downtime deployment path that includes rollback?

Send the runtime, traffic router, deployment method, database migration pattern, and current smoke checks. SteadyOps will map the safest release sequence.

Request Deployment Safety Review Review service scope

Focused request

Need a zero-downtime deployment path that includes rollback?

Send your current stack and the production risk. Optional commercial details can be added after the technical context.

Selected review Request Deployment Safety Review
Add name, company, and budget (optional)

Typical response time: within 24 hours. No sales call is required before the technical context is reviewed.