DevOps

Zero-downtime deployments: A field guide

The deployment patterns that let us ship mid-day without anyone noticing.

EX
ExpressCore Cloud
DevOps & SRE
Zero-downtime deployments: A field guide
Zero-downtime deployments: A field guide

The ability to deploy at 2pm on a Tuesday, with real users on the site, and have nobody notice is one of the clearest signs of engineering maturity. It is not magic — it is a set of well-understood patterns that, combined, remove the deployment from the list of things that can cause an outage. This field guide walks through the techniques we use to ship continuously without a maintenance window.

Why Zero-Downtime Matters Beyond Uptime

The obvious benefit is availability, but the deeper benefit is psychological. When deploys are safe and boring, teams deploy more often, in smaller batches. Small batches are easier to review, easier to debug, and easier to roll back. Fear of deployment is what pushes teams toward risky big-bang releases in the first place.

The Core Deployment Strategies

Rolling deployments

Instances are updated a few at a time behind a load balancer while the rest keep serving traffic. Simple and resource-efficient, but it means two versions of your code run simultaneously — which drives the backward-compatibility rules below.

Blue-green deployments

You run two identical environments. The new version goes live on the idle one, gets verified, and traffic is switched over instantly. Rollback is just as instant — flip traffic back. The cost is running double the infrastructure during the cutover.

Canary deployments

The new version receives a small slice of traffic — 1%, then 5%, then 25% — while you watch error rates and latency. If metrics stay healthy, you ramp up; if not, you pull it back before most users ever touch it. This is the safest option for high-risk changes.

Blue-green answers "can we switch instantly?" Canary answers "should we?" Mature teams use both together.

The Hard Part: Database Migrations

Code is easy to roll back; data is not. The single biggest cause of deployment outages is a schema change that is incompatible with the currently running code. The solution is the expand-and-contract pattern, applied over multiple deploys:

  • Expand. Add the new column or table without removing anything. The old code ignores it; the new code can use it. Both versions run happily.
  • Migrate. Backfill data and switch the application to write to and read from the new structure.
  • Contract. Only after the old code is fully retired do you drop the old column. This step happens in a later deploy, never the same one.

The golden rule: never rename or drop a column in the same deploy that stops using it. Every migration must be backward compatible with the version of the code currently in production.

The Supporting Infrastructure

Zero-downtime depends on a few unglamorous pieces working correctly:

  • Health checks that accurately report readiness, so the load balancer never routes traffic to an instance that is still starting up.
  • Graceful shutdown, so an instance being retired finishes its in-flight requests instead of dropping them.
  • Connection draining at the load balancer to stop sending new requests to a departing instance.
  • Automated rollback triggers tied to error-rate and latency thresholds, so a bad deploy reverts without waiting for a human.

Feature Flags: Decoupling Deploy From Release

The most powerful technique is to separate deploying code from releasing a feature. With feature flags, new code ships to production dark — present but inactive — and you turn it on for users independently, gradually, and reversibly. A deploy stops being a risky event because the new behavior is not live until you decide it is.

Conclusion

Zero-downtime deployment is the compound result of many small disciplines: rolling or blue-green infrastructure, canary analysis, backward-compatible migrations, honest health checks, and feature flags. Adopt them incrementally. Each one independently makes deploys safer, and together they turn shipping from a stressful event into a routine, invisible part of the day.