Rolling, blue-green or canary?
| Dimension | Rolling deployments | Blue-green deployments | Canary releases |
|---|---|---|---|
| In one line | Replace instances a batch at a time | Build a second environment, then switch all traffic to it | Give the new version a small share of traffic, then widen it |
| Extra capacity | None to one batch, depending on surge settings | A full second copy during the release (ECS warns it may double resource use) | A few extra instances, or none if the platform splits traffic between versions |
| Rollback speed | Slow: another rollout, batch by batch | Seconds: switch the router back, while the old side is still running | Fast: set the canary’s weight to 0 |
| Versions live at once | Two, mixed, for the length of the rollout | One serving traffic; both running until the old side is scaled down | Two, side by side, for the whole rollout |
| Blast radius of a bad release | Each batch that passes health checks; a bug that health checks miss reaches everyone | Everyone, from the moment of the switch until you switch back | Only the canary’s share, if you catch it before widening |
| What it needs | Several instances, health checks or readiness probes, backward-compatible changes | Room for two environments, a switchable router or DNS, schema changes split into expand and contract | Weighted routing, good metrics compared against the stable version, enough traffic for a signal |
| Best for | Everyday releases of stateless services; the default strategy of a Kubernetes Deployment | Releases that need instant rollback or can’t run mixed for long | High-traffic services where a regression must reach as few users as possible |
| Built into | Kubernetes Deployments, ECS, EC2 Auto Scaling instance refresh, VM Scale Sets | ECS, CodeDeploy, App Service slots, Argo Rollouts | Lambda aliases, API Gateway, Cloud Run, CodeDeploy, ECS, Argo Rollouts, Flagger |
Rule of thumb
Start with rolling deployments; they are the default for a reason and cost nothing extra. Add blue-green when a slow rollback would hurt more than paying for a second environment, and canaries when you have the traffic and the metrics to judge a new version on a slice of users. They combine: Amazon ECS canary deployments shift traffic between a blue and a green revision, and many teams canary first and then roll the rest. All three keep two versions alive for a while, so database changes still need expand and contract.
Sources
- Kubernetes docs: Deployments (RollingUpdate)
- Amazon ECS docs: Deploy services by replacing tasks
- Amazon ECS docs: Blue/green deployments (may double resource usage)
- Amazon ECS docs: Canary deployments (bake time, blue and green revisions)
- Martin Fowler: BlueGreenDeployment
- Danilo Sato: CanaryRelease
- Danilo Sato: ParallelChange (expand and contract)
- Google SRE Workbook: Canarying releases
- Argo Rollouts docs: Overview (limits of rolling updates)
- AWS Lambda docs: Canary deployments using a weighted alias
- API Gateway docs: Canary release deployment
- Google Cloud docs: Cloud Run traffic migration
- Microsoft Learn: Azure App Service deployment slots
- Microsoft Learn: Upgrade policy modes for Virtual Machine Scale Sets
- EC2 Auto Scaling docs: Instance refresh
- CodeDeploy docs: Deployment configurations
- Flagger on GitHub