Choosing and Implementing Deployment Strategies
This lesson explains how a deployment strategy determines how a new version replaces the old one, how much is at risk at any time and how quickly a bad release can be reversed.
Learning outcomes
After completing this lesson, you will be able to:
- Compare all-at-once, rolling, blue/green and canary strategies.
- Implement strategies on each compute platform.
- Make deployments safe with alarms and automatic rollback.
The strategies
All at once (in place) updates every instance simultaneously; it is fast and cheap but causes downtime and a full outage if the version is bad. Rolling updates batches of instances in place, keeping some capacity serving, but running mixed versions during the deployment and reducing capacity unless extra instances are added (rolling with additional batch). Immutable launches a completely new set of instances with the new version and switches to them only when healthy, so rollback is just terminating the new instances. Blue/green runs a full new environment (green) next to the current one (blue) and switches traffic at the load balancer or DNS, allowing instant rollback by switching back. Canary sends a small percentage of traffic to the new version first, then the rest; linear shifts traffic in equal increments at intervals.
| Strategy | Downtime | Rollback speed | Extra cost during deploy | Risk exposure |
|---|---|---|---|---|
| All at once | Yes | Slow (redeploy) | None | All users |
| Rolling | No (reduced capacity) | Slow (roll back batches) | None or one batch | Growing share |
| Immutable | No | Fast | Double capacity briefly | Limited until switch |
| Blue/green | No | Instant (switch back) | Full second environment | Controlled at switch |
| Canary / linear | No | Instant (shift back) | Some extra capacity | Small share first |
The following diagram orders the strategies by risk.

Deployment strategies
Implementing strategies on AWS
Each compute platform has its own mechanism. For EC2 Auto Scaling groups, instance refresh implements rolling or immutable-style replacement with minimum and maximum healthy percentages, checkpoints and alarm-based rollback, and blue/green is implemented with two groups behind ALB weighted target groups or Route 53 weighted records. For ECS, services support rolling updates with the circuit breaker and built-in blue/green, linear and canary deployments. For Lambda, alias weighted routing shifts a percentage of invocations to a new version. CloudFormation updates with UpdatePolicy perform rolling or replacing updates of Auto Scaling groups. AWS CodeDeploy remains available for EC2, on-premises, ECS and Lambda deployments with deployment configurations such as CodeDeployDefault.HalfAtATime and canary or linear traffic shifting.
| Platform | Rolling / immutable | Blue/green | Canary / linear |
|---|---|---|---|
| EC2 Auto Scaling | Instance refresh | Two groups + ALB weighted target groups or Route 53 weighted | ALB weights adjusted in steps |
| ECS | Rolling update with circuit breaker | Built-in blue/green | Built-in linear and canary |
| Lambda | - | Alias switch | Alias weighted routing |
| DNS level | - | Route 53 weighted or failover records | Route 53 weights |
Deployment safety
Safe deployments limit the blast radius and detect problems automatically. CloudWatch alarms on error rates and latency tied to automatic rollback (instance refresh, ECS deployments, CloudFormation rollback triggers), bake times between stages, health checks that reflect real readiness, and deploying to one AZ or Region before others are all signs of a well-designed answer. DNS-based switching is subject to client caching, so load balancer weights switch traffic faster and more predictably than DNS changes.
Safe deployments
Choosing a strategy
A team deploys a new version of a web application running in an Auto Scaling group behind an ALB. Requirements are no downtime, the ability to roll back within one minute, and no mixed versions serving the same user session. Rolling updates mix versions and roll back slowly. The team creates a second Auto Scaling group (green) with the new launch template, registers it with a second target group, and uses an ALB listener rule with weighted target groups and target group stickiness to move 10%, then 50%, then 100% of traffic. Rolling back is changing the weights back to blue.
Which strategy causes downtime?
Show answer
All at once, because every instance is updated at the same time.
Exam Tips
Remember for the exam
- Immutable and blue/green give the fastest rollback; all at once causes downtime.
- Instance refresh implements rolling replacement for Auto Scaling groups.
- ALB weighted target groups switch traffic faster than DNS.
- Lambda alias weights and ECS built-in strategies provide canary and linear deployments.
- Tie deployments to CloudWatch alarms for automatic rollback.