Zero-Downtime Deployment: Blue-Green, Canary, and Rolling Strategies Explained

In short: Zero-downtime deployment means shipping a new version of your app without taking the service offline or dropping requests, and it's a choice between three strategies — rolling, blue-green, and canary — not a single technique. Each trades infrastructure cost against rollback speed and exposure control, and the strategy you pick matters less than whether your database migrations are actually backward-compatible, which is where most "zero-downtime" releases quietly fail anyway.
What this means for you
- Rolling deployment is a reasonable default with no extra infrastructure cost; blue-green and canary solve specific problems rolling doesn't.
- A deployment strategy alone doesn't guarantee zero downtime — your database migrations have to be backward-compatible too.
- Pick the strategy based on rollback-speed needs and schema-migration complexity, not on which one sounds most advanced.
"Zero-downtime deployment" gets used as if it's one thing you either have or don't. In practice it's an outcome — no dropped requests, no maintenance window — that three different strategies achieve in three different ways, at three different costs. Picking the wrong one for your situation either wastes infrastructure budget or leaves you exposed exactly where you needed protection.
The three strategies, compared
Rolling deployment
Instances are replaced a few at a time behind a load balancer: take one (or a small batch) out of rotation, deploy the new version, run a health check, add it back, repeat until every instance is updated. It's the default in most orchestrators (Kubernetes, ECS) and needs no extra infrastructure — you're using the capacity you already have.
The trade-off is that old and new versions serve traffic side by side for the whole rollout, and a bad rollback means rolling back the same way, instance by instance, which takes minutes rather than seconds.
Blue-green deployment
You run two complete, identical production environments — "blue" (current) and "green" (new). Deploy and fully test the new version on green while blue keeps serving all live traffic, then switch the router or load balancer to send everything to green at once. If something's wrong, you switch back to blue instantly.
The cost is real: you're paying for double the compute for the duration of the switch, and for a period both environments need to point at data that either version can read and write correctly. In exchange, you get the fastest possible rollback and no window where both versions serve production traffic simultaneously.
Canary deployment
The new version goes out to a small slice of real traffic first — often 1-5% — while the rest keeps running the old version. If error rates, latency, and business metrics hold up, that percentage increases in stages until the rollout is complete; if they don't, only a small fraction of users were ever affected.
Canary needs solid observability to be worth doing — without real-time error and latency dashboards split by version, you can't actually tell whether the canary is healthy, which defeats the point.
| Strategy | Infra cost | Rollback speed | Best for |
|---|---|---|---|
| Rolling | None extra | Minutes | Most applications; the sensible default |
| Blue-green | Doubled, temporarily | Seconds | Releases where any downtime risk is unacceptable |
| Canary | Low-moderate | Fast, and limited blast radius | High-traffic products where gradual validation matters |
How to choose
Four questions settle it for most teams:
- How fast do you need to roll back? If "seconds" is a hard requirement, blue-green is the only strategy built for that.
- Can you afford doubled infrastructure, even temporarily? If not, rolling or canary are the realistic options.
- How complex are your database migrations? Any strategy that runs two application versions side by side — which is all three, briefly — needs schema changes that both versions can work with (more on this below).
- How good is your monitoring? Canary only works if you can actually see per-version error rates and latency in real time. Without that, you're not canarying, you're just deploying slowly.
The part most teams get wrong: database migrations
A deployment strategy controls your application code. It does nothing for your database schema — and for the seconds or minutes that old and new application versions are both live (which happens under rolling, blue-green, and canary alike), both versions have to work correctly against the same database.
A migration that adds a required column, renames a column, or drops one the old code still reads will break the previous version the instant it runs, even if your deployment strategy is otherwise flawless. This is the most common reason a team ships a technically correct blue-green or canary pipeline and still gets a production incident on release day.
The fix is the expand-contract pattern: split every schema change that isn't backward-compatible into two separate migrations. First, "expand" — add the new column or table alongside the old one, so both application versions still work. Deploy the new app version once the expand migration is live. Only after the old version is fully retired do you "contract" — a second migration that removes what's no longer needed. It's slower than a single migration, and it's the difference between a deployment strategy that works on paper and one that actually holds up in production.
A minimal zero-downtime deployment checklist
- Health checks that gate traffic — an instance only receives requests after it reports healthy, not after the process starts.
- A load balancer or router capable of gradual or instant traffic shifting, depending on the strategy chosen.
- Backward-compatible database migrations, split via expand-contract wherever a change isn't naturally compatible.
- Automated rollback triggered by error-rate or latency thresholds, not a manual "someone notices and pages the on-call."
- Version-aware monitoring, so you can tell what's happening on the new version specifically, not just in aggregate.
Getting all five in place is the actual work behind "zero-downtime deployment" — the strategy name is the easy part. If you're moving off manual deploys or a maintenance-window release process, our cloud & DevOps consulting work is built around exactly this: CI/CD pipeline design and zero-downtime deployment strategy without the production incidents that come from getting it half right.
Frequently asked questions
What is zero-downtime deployment?
Zero-downtime deployment is a release process where a new version of an application goes live without taking the service offline or dropping user requests. It's achieved through strategies like rolling updates, blue-green deployments, or canary releases, combined with a load balancer or router that only sends traffic to instances confirmed healthy on the new version.
What's the difference between blue-green and canary deployment?
Blue-green deployment runs two full, identical production environments and switches all traffic from the old one to the new one at once, so rollback is an instant traffic switch back. Canary deployment routes a small percentage of real traffic (often 1-5%) to the new version first, watches it, then gradually increases that percentage — trading a slower rollout for earlier, lower-risk detection of problems.
Is rolling deployment good enough, or do I need blue-green?
Rolling deployment, where instances are replaced a few at a time behind a load balancer, is a reasonable default for most applications and costs nothing extra in infrastructure. Blue-green is worth the doubled compute cost when a bad release needs to be reversible in seconds rather than minutes, or when you can't tolerate two application versions running side by side even briefly.
Why does my database migration break zero-downtime deployments even when the app doesn't go down?
Because a migration that adds a NOT NULL column, renames a column, or drops one that the old code still reads will break the previous application version the moment it runs, even for the seconds or minutes both versions are live during a rolling or blue-green rollout. The fix is the expand-contract pattern: first ship a schema change that both the old and new app versions can work with, deploy the new app version, then ship a second, separate change that removes what's no longer needed.
How long does it take to set up zero-downtime deployments for an existing app?
It depends on your current infrastructure and how much of your data layer needs to change to support backward-compatible migrations — an app already running behind a load balancer on containers is a different scope of work than one migrating off a single VM. We scope this during discovery rather than quoting a fixed timeline up front, because the honest answer changes based on what's actually running today.
Sources
- HashiCorp: Implement zero-downtime deployments with blue/green, canary, and rolling strategies — The definitions and trade-offs of the three core zero-downtime deployment strategies.
- Octopus Deploy: Blue/green vs canary deployments — 6 differences and how to choose — The decision factors used in the 'how to choose' section (rollback speed, infrastructure cost, exposure control).
- Harness: Zero-Downtime Database Migrations — Safe Schema Changes — The expand-contract pattern for backward-compatible schema migrations.
Need help putting this into practice?
Tech Programmer builds and ships this work for startups and enterprises. Tell us what you are trying to do and we will tell you what it takes.
Related reading
- Custom Software vs. Off-the-Shelf: How to Decide (and the Signs You've Outgrown It)Off-the-shelf software wins on speed and low upfront cost. Custom software wins when your workflow, data, or differentiation no longer fit what you can buy. Here is how to tell which side of that line your business is on.
- How Much Does AI Integration Cost in 2026? A Realistic Pricing GuideAI integration costs range from about $10,000 for a single API-based feature to $500,000+ for a production agent platform. Here is what actually drives that number, and how to keep your project on the cheap end of its range.
