AWS in 1 Min · Episode 173

Blue/green vs canary vs rolling deployments on AWS

Three ways to ship safely. Watch the one-minute video, then read the details.

David Gomez1:17 video · 2 min read

"There's one safe way to deploy." There are three, and each one trades speed, cost and risk differently. The right choice depends on what a bad release would cost you: a few confused users, or every customer at once.

Rolling: replace in batches

A rolling deployment updates your servers or containers in batches: take a few out, install the new version, put them back, repeat.

  • Pro: no extra capacity. You never run more machines than usual (or only a small surge).
  • Con: for a while, old and new versions run side by side, so both must work with the same database and API.
  • Con: rolling back is another rolling deployment, batch by batch, which is slow when things are on fire.

On AWS this is the default for ECS services and the in-place mode of CodeDeploy (OneAtATime, HalfAtATime).

Blue/green: build a copy, switch

Blue/green builds a complete second environment (green) with the new version next to the current one (blue), tests it, then switches all traffic at the load balancer or DNS.

  • Pro: rollback is instant: switch back to blue, which is still running.
  • Pro: you can test green with real infrastructure before any user sees it.
  • Con: for a while, you pay for two environments.

Canary: a small slice first

Canary sends a small slice of traffic, say 10 percent, to the new version. If the alarms stay quiet for a set time, the rest follows; if not, the slice goes back. Linear is the patient variant: equal steps, such as 10 percent every few minutes.

  • Pro: real users test the release, but only a few of them.
  • Con: you need good metrics and alarms; a canary nobody watches only delays the outage.

How to choose

  • Small team, cost-sensitive, backward-compatible change: rolling.
  • Big or risky change, fast undo matters more than cost: blue/green.
  • High traffic, user-facing, good monitoring: canary or linear.

On AWS, CodeDeploy offers these for EC2, Lambda and ECS; Amazon ECS has built-in blue/green, linear and canary (since 2025) besides rolling; and SageMaker AI endpoints have deployment guardrails. All of them can use CloudWatch alarms to roll back automatically. A common mistake is choosing a strategy without deciding which alarm means "stop": define it first.

Where AI fits

New models deserve a canary even more than code, because a model can be "working" (no errors) and still worse. On a SageMaker AI real-time endpoint, deployment guardrails run a blue/green update with canary or linear traffic shifting: a few percent of requests go to the new model, a baking period watches your CloudWatch alarms, and any alarm sends all traffic back to the old fleet. For models you call through Amazon Bedrock, there is no endpoint to shift, so you split traffic in your own code (or with a Lambda alias and CodeDeploy) and compare quality metrics between the two.

Quick recap

  • Rolling saves capacity but rolls back slowly.
  • Blue/green costs double for a while but rolls back instantly.
  • Canary tests on a few real users first; it needs good alarms.
AWS in 1 Min #173 · 1:17

Need an AWS expert on your team?

I'm David, an AWS expert and fractional cloud consultant. I work alongside your team to run your cloud and infrastructure: architecture, security, cost and day-to-day operations. You get senior AWS experience when you need it, without the cost of a full-time hire.

  • Architecture reviews and a clear plan for what to fix first
  • Security hardening: IAM, networking, audits
  • Lower AWS bills without slowing your team down
  • Hands-on help with AI workloads on AWS