A team ships a new checkout service on a Thursday. Green passed every smoke test. They flip the router and all traffic moves at once. Forty minutes later, support finds that every total paid in yen has a rounding error on it. No fixture in the smoke suite used yen. Flipping back to blue takes seconds and works exactly as designed, but by then every yen customer who checked out in those forty minutes has seen the bug.
Run the same release as a canary and maybe 5% of those customers meet the bug first. The price is an afternoon. Full traffic arrives hours later instead of in one switch, and two versions of checkout run side by side until it does.
Key Takeaways
- Blue-green runs two full environments and moves all traffic at once. A canary sends a small share of traffic to the new version and widens it while metrics hold.
- With blue-green, every user meets a bad release until someone flips the router back.
- Both need a database schema that old and new code can read at the same time.
- A canary on low traffic can pass a bad build simply because too few requests went through it.
- The two combine well. Many teams switch builds blue-green and canary individual features behind a flag.
1. The short answer
A blue-green deployment keeps two production environments. Blue serves every user while green gets the new release and is checked with no users on it. When green looks right, the router sends all traffic to it in one step, and switching back is the rollback.
A canary release deploys the new version beside the old one and gives it a slice of live traffic, somewhere between 1% and 10% in most setups. Errors and latency on that slice get compared with the old version’s. If they hold, the share goes up in steps until the new version carries everything, and if they don’t, traffic goes back to the old one.
So what are you protecting against? With blue-green a bad release reaches everyone and can be gone within seconds of someone noticing, while a canary keeps the first group small and takes hours to reach the rest.
| Blue-green | Canary | |
|---|---|---|
| First exposure | All users at cutover | A small share, often 1–10% |
| Time to full traffic | One switch | Minutes to days, step by step |
| Rollback | Flip the router back | Shift the weight back to the old version |
| Infrastructure | Two full environments during the switch | Old fleet plus a few new instances |
| Versions live at once | One, apart from the moment of cutover | Two, for the whole rollout |
| Catches | Bugs the pre-switch checks find | Bugs that show up only on real traffic |
2. How a blue-green deployment works
Martin Fowler’s 2010 write-up is still the reference most people cite, and he credits the name to “some foggy combination of Daniel Terhorst-North and Jez Humble.” You stand up green as a copy of production, deploy the new version to it, and test it there while blue carries every user. Then the router changes where it points.
That gap before the switch is what people usually mean by blue green testing: smoke tests, synthetic transactions and a few manual clicks against green. Argo Rollouts gives the gap names in Kubernetes. A preview service sends test traffic to the new version, an active service carries production, and promotion swaps them. Spinnaker called the pattern red/black for years and renamed it blue/green in version 1.30.
Fowler’s case for it is the rollback: “if anything goes wrong you switch the router back to your blue environment.” Blue is still running. Its caches are warm and its connection pools are open. Argo keeps the old ReplicaSet up for 30 seconds by default after promotion, mostly so nodes have time to update their routing, and most teams hold blue far longer than that, at least until the next release needs the slot.
3. How a canary deployment works
Danilo Sato’s canary release article (2014) traces the name to miners, who carried a caged canary underground because toxic gas would kill the bird before it killed them. Here the canary is a small group of real users who meet the new version before anyone else.
A few instances of the new version go up beside the existing fleet, and the load balancer or service mesh sends them a weighted share, say 5% of requests. Argo Rollouts writes the plan as steps (setWeight: 10, a one-hour pause, setWeight: 20 and so on), and a pause with no duration waits for a person to promote it.
What does canary testing mean in practice? You compare the canary’s error rate, latency and saturation with the old version’s over the same window. Argo’s analysis runs and Flagger automate the comparison. Either can promote or abort. Done by hand, it’s somebody watching two lines on a dashboard and deciding when to widen.
Sato also lists ways to choose the canary group. Random sampling is the load balancer default. Employees first, one region first or one brand first all need something that knows who the user is.
4. Side by side: how traffic moves
It’s easiest to see on a chart.
Blue-green does all of its checking before any user arrives. On the canary side the checking happens after the deploy and on real traffic, so whoever hits a missed bug first belongs to a small slice. That takes time. A five-step canary with an hour at each step eats most of a working day.
On infrastructure the canary is cheaper, at least at first. Blue-green needs a full second copy of production for as long as green is under test and blue is held for rollback, and for a large stateful service that second copy costs real money. A canary starts with a handful of extra instances. By its last step it has replaced most of the fleet, and both versions have served production the whole way.
5. Where each one breaks
Databases. Old and new code have to work against the same database during the switch, whichever strategy you use. Fowler’s advice for blue-green is to “separate the deployment of schema changes from application upgrades.” Add the new column in a release that the old code ignores, ship the code that uses it, and drop the old column later. Sato points to the same parallel-change approach for canaries. A canary has it harder, since the two versions write to the same tables for hours instead of seconds.
Sessions. These mostly hurt canaries. Most load balancers split traffic by request. Without session affinity, one user can land on the new version for one page and the old version for the next. That’s annoying for a UI change. It can corrupt state if the two versions store a cart or a draft in different shapes.
Low traffic. Say a service gets 2,000 requests an hour and the new build fails one in 500. An hour at 5% sends the canary about 100 requests, which works out to 0.2 expected failures. Nothing shows. The build gets promoted on a green dashboard, and on a quiet service the fix is to hold the canary far longer or start it at a larger share.
Inputs the tests never saw. Blue-green leans hard on its test suite, and the yen bug is the usual way that goes wrong. Real users send currencies, locales and payload sizes your fixtures never had, and a green that passed every check meets all of them at once.
Long-lived connections. WebSockets, server-sent event streams and gRPC streams stay on whichever version they connected to. Flipping the router moves new connections only. Existing ones drain on their own schedule, which can mean hours of traffic still on blue after the switch.
6. How to choose between them
Work through these for the service you’re releasing.
- Can a small group of real users tell you something your tests can’t? Payment flows, search ranking and anything that depends on real data usually say yes. That points to a canary.
- Do you have the traffic? If a 5% slice sees fewer than a few hundred requests in your hold window, a canary won’t show much. Blue-green with thorough pre-switch tests may tell you more.
- Can two versions run side by side? If old and new can’t share a schema, a cache format or a queue message format, fix that first. Until then, blue-green’s short overlap is the safer of the two.
- Can you afford a second environment? For a large stateful service, a full green copy can be expensive. A canary adds capacity gradually instead.
- Is the change in the build or in a feature? A runtime upgrade, a dependency bump or new infrastructure lives in the build. A new checkout flow is a feature that happens to ship in a build. The next section is about that difference.
Plenty of teams run both, blue-green for platform changes and canaries for application releases in one cluster, since Argo Rollouts picks the strategy per Rollout.
7. Put the canary on the feature
Both strategies move traffic between builds. Most releases, though, are one or two risky features riding along with a dozen safe commits. When the yen bug shows up, a build-level rollback pulls every one of those commits too.
A feature flag moves the canary down a level. The new code ships in the build switched off, and a percentage rollout on the flag serves it to 1% of users, then 5%, then 25%. The build itself can go out blue-green with nothing visible changing, and the feature then gets its own canary on its own schedule. If the metrics turn, a kill switch sends everyone back to the old path in seconds, and the rest of the release stays live.
A flag also removes the session problem from section 5, because it decides per user. The SDK hashes the user ID with a per-flag salt, so the same person gets the same answer on every request, which is sticky bucketing. It handles Sato’s other cohorts too. A targeting rule can serve the canary to staff first, or to one region, before any percentage starts. The rollout strategies docs cover how the bucketing and rules combine.
A flag can’t canary everything, though. A new JVM version, a changed connection pool size or a library upgrade has no flag to hang on. Those still need a canary or blue-green switch at the deployment layer, and the progressive delivery explainer maps which technique fits which kind of risk. If you want the feature in production before anyone sees it, a dark launch at 0% comes before the first percentage step.
8. Running a feature canary in Featureflip
Wrap the new path in a flag, deploy it switched off, and add a percentage rollout to the rule you want to canary. Bucket by defaults to user_id. Switch it to accountId if everyone in an account should see the same thing, or to an anonymous_id for logged-out visitors. Changes reach connected SDKs over the stream within seconds, so 1% to 5% is a dashboard edit.
A rollout ramp takes the manual steps out by raising the percentage on a schedule you set. Pair it with a flag trigger. That’s a secret URL your Datadog or Grafana alert calls when the error rate climbs, and it turns the flag off, which pauses the ramp at its current step until someone looks in the morning. Automating the ramp goes through hold times and what should stop one. Ramps and triggers come with the Team plan and above.
The shorter version
- Blue-green switches all traffic at once between two environments. A canary moves a small share first and widens it.
- A bad blue-green release reaches every user until someone flips back.
- Both need a database schema that old and new code can share.
- Canaries need traffic. On a quiet service, hold longer or start larger.
- Keep build-level changes on blue-green or a deployment canary. Canary individual features behind a flag.
Frequently asked questions
What is the difference between canary and blue-green deployment?
Blue-green runs two complete production environments and moves all traffic from the old one to the new one in a single switch, with switching back as the rollback. A canary deploys the new version alongside the old one, sends it a small share of traffic, and raises that share step by step while its metrics stay healthy.
What does blue green testing mean?
It means the checks you run against the green environment before the switch, while blue still serves every user. Smoke tests, synthetic transactions and manual clicks all count. No real users are split between the two versions, which makes it a different thing from an A/B test. Green gets production traffic only once the router flips.
What does canary deployment mean?
A canary deployment releases a new version to a small slice of real traffic before everyone else gets it. The name comes from miners who carried canaries underground as an early warning of gas. If the canary slice shows more errors or slower responses than the old version, traffic goes back and only that slice was affected.
Can you use canary and blue-green together?
Yes, and it’s common. One pattern ships the build blue-green, with the risky feature switched off behind a flag, and then canaries the feature with a percentage rollout. Argo Rollouts also lets you pick either strategy per service in the same cluster, so platform components can switch blue-green while application services run canaries.
Can feature flags replace canary deployments?
For application features, mostly yes. A flag can serve new code to 1% of users and turn it off in seconds without touching the deployment. Changes with no code path to wrap, like a runtime upgrade or new infrastructure, still need a canary or blue-green switch at the deployment layer.
Featureflip is a flat-priced feature flag platform with percentage rollouts, rollout ramps, flag triggers and a cleanup Action that opens a pull request to remove each dead flag on GitHub, GitLab or Bitbucket. Start on the Free plan without a credit card.