Rolling vs Blue-Green vs Canary Deployment: How to Choose

Rolling, blue-green, and canary deployments all release a new version with no downtime. They differ in three things: extra infrastructure cost, how many users a bad release can reach, and what tooling you need. Match those three to your constraints and the right strategy is usually clear.

Start this project - freeLive cloud workspace in your browser · lands on your portfolio
DevOps Engineerdeploymentcanaryblue-green

The three strategies in one sentence each

Rolling deployment

# One instance at a time: drain, replace, wait until ready, continue
for pod in 1 2 3; do
  echo "pod $pod: drain -> replace -> wait for ready"
done

Blue-green deployment

Canary deployment

95% -> v1   (old)
 5% -> v2   (new)   watch errors, then 25% -> 50% -> 100%

Side-by-side comparison

Rolling Blue-green Canary
Extra infra cost None / minimal ~2x during switch Small
Mixed versions live Yes No Yes (by design)
Rollback Roll back again Instant switch Shift traffic back
Needs traffic splitting No No (one switch) Yes
Needs good metrics Helpful Helpful Required

How to choose: a worked example

Workload constraints:

Go through the options:

  1. Blue-green needs 2x capacity during the switch. The budget rules it out.
  2. Canary needs weighted traffic splitting. There is none, so a "5% canary" is not possible - traffic simply goes wherever the Service sends it.
  3. Rolling needs no extra capacity and no extra tooling. Replacing one of three replicas at a time limits a bad release to part of the traffic, and you can stop the rollout as soon as errors appear.

Rolling wins. This is why it is the default for most workloads.

Rules of thumb

Do this project yourself. It's ready in a live cloud workspace in your browser - when you finish, it lands on your portfolio.

Start this project - free

What you'll practice

FAQ

What is the difference between blue-green and canary deployment?

Blue-green moves all traffic from the old fleet to a full new fleet in one switch, with instant rollback. Canary sends a small share of traffic to the new version first and increases it step by step, which needs weighted traffic splitting.

Which deployment strategy does Kubernetes use by default?

A Kubernetes Deployment uses a rolling update by default. You control its speed with maxSurge and maxUnavailable.

Is a rolling update zero downtime?

Yes, if readiness probes are set and the old and new versions are compatible. Kubernetes only sends traffic to new pods once they report ready.

Do I need a service mesh for canary deployments?

You need some way to split traffic by weight. A service mesh is one option; a weighted load balancer, nginx upstream weights, or a tool like Argo Rollouts also works.

Keep learning

Release a New Image With a Rolling UpdateDevOps projectBlue-Green Deployment With NginxDevOps projectWrite a PodDisruptionBudget and Spread ConstraintsDevOps projectDevOps roadmapStep by step to hiredDevOps interview questionsSTAR answersAll DevOps projectsProjects hub

Do this project yourself. It's ready in a live cloud workspace in your browser - when you finish, it lands on your portfolio.

Start this project - free
Start this project - free