Blue/green or rolling deployments on ECS: which should a small team use?
By the Keel team · Last checked · 7 min read
Short answer
For most small teams, rolling deployments with the ECS deployment circuit breaker and automatic rollback are enough. Choose blue/green when you want to test the new version before it takes production traffic, or want a quick switch back while the old version is still running. Either way, the health check decides whether a release is safe, so get that right first.
What is the difference between blue/green and rolling deployments on ECS?
A rolling update replaces running tasks with new ones inside the same service, a few at a time, while blue/green starts the whole new revision beside the old one and then moves traffic across.
AWS's ECS documentation describes the blue deployment as the current production revision and the green deployment as the new one you want to put in its place.
| Rolling | Blue/green | |
|---|---|---|
| How it works | Replaces tasks gradually, within limits you set | Runs the new revision alongside, then shifts traffic |
| Test before real traffic | No, new tasks take traffic once healthy | Yes, through a test traffic stage and lifecycle hooks |
| Going back | Rolls back to the previous revision, which starts tasks again | Blue keeps running until the bake time ends, so traffic can move back |
| Extra cost | Little, a temporary extra task or two | AWS says it may double resource usage during a deployment |
| Setup effort | Low | Higher: listeners, hooks and bake time to think about |
Do you still need CodeDeploy for ECS blue/green?
No, ECS now has a built-in blue/green strategy, so CodeDeploy is not required.
AWS announced on 17 July 2025 that Amazon ECS supports it along with deployment lifecycle hooks, and the current documentation describes blue/green in terms of ECS service revisions rather than CodeDeploy.
If you read older tutorials that tell you to create a CodeDeploy application and deployment group first, they predate this. Check that your infrastructure code and the ECS settings you use match the current AWS documentation, because the option names differ between the console, the API and infrastructure tools.
The built-in strategy works with Application Load Balancers, Network Load Balancers and Service Connect, according to the announcement, and the documentation notes that Network Load Balancers add about 10 minutes to the traffic-shift stages.
How do you set up rolling deployments safely?
A few service settings do most of the work: the healthy and maximum percentages, the deployment circuit breaker and a health check that tests something real.
The documentation defines minimumHealthyPercent as the lower limit of running healthy tasks during a deployment and maximumPercent as the upper limit.
Take a service with four desired tasks. With a minimum of 100 and a maximum of 200, ECS can start four new tasks before it stops any old ones, so capacity never drops below four. With a minimum of 50, the documentation notes the scheduler can stop two existing tasks before starting two new ones, which halves your capacity mid-deploy.
- Set the healthy minimum high enough that a deploy never removes capacity you need.
- Leave room above the desired count so ECS can start new tasks before it stops old ones. AWS warns the scheduler must be able to stop or start at least one task, or the deployment sticks.
- Turn on the deployment circuit breaker with rollback, which stops a deployment when tasks cannot start.
- Add CloudWatch alarms as a second detector, based on application metrics. AWS says that when both methods are used, the deployment fails as soon as either criterion is met.
- Point the load balancer health check at an endpoint that checks the database. What a deployment health check should test covers what to include.
To wire this into a pipeline, see how to roll back a failed ECS deployment automatically with GitHub Actions.
When is blue/green worth the extra cost and setup?
Blue/green is worth it when a bad release is expensive enough that you want to look at the new version before customers reach it, or when you need a fast way back.
The documentation says you can validate new revisions before production traffic reaches them and, if the green revision misbehaves, revert to blue without extended disruption.
- A failed release during a customer's working day would cost you a contract or a support week.
- You want smoke tests to run against the new revision with test traffic first. Lifecycle hooks can run a Lambda function or pause the deployment until you continue it.
- You want a bake time, a period after the shift when both revisions run, so blue is still there if error rates climb.
- A customer's security questionnaire asks how you test releases before they go live.
The cost is real but bounded. Running two full revisions at once may double resource usage for the length of the deployment, so a service of four small tasks briefly runs eight. For a few minutes a day that is small; for a large service with a long bake time it is not.
What problems can health checks not see?
Health checks see whether a task starts and answers, not whether a feature is correct, so some bad releases pass them and fail later.
A bug in one feature, a slow query under real load or a broken payment path can all return healthy responses.
Three things cover that gap. Alarms on error rate and latency for the first 15 to 30 minutes after a deploy catch what the load balancer cannot. ECS supports CloudWatch alarms as a deployment failure method with rollback, so an alarm can undo a release without a person. And a feature flag lets you switch one feature off without redeploying: do small teams need feature flags explains how to start.
Do blue/green deployments help with database migrations?
Not by themselves, because the blue and green revisions talk to the same database.
If the new revision needs a schema the old one cannot use, switching traffic back leaves the old code running against a database it does not understand.
The fix is the same for both strategies: make every migration safe for the version before it and the version after it. Rolling back an ECS deployment when migrations already ran and running PostgreSQL migrations without downtime cover how.
Which should a small team start with?
Start with rolling deployments, the circuit breaker, alarms and a health check you trust, then move to blue/green when a failed release would hurt badly enough to justify the cost and setup.
That order gets you automatic rollback quickly, and it keeps the option open.
For the wider habits around frequent releases, see how small SaaS teams ship on AWS without breaking production and whether it is safe to deploy on a Friday.
Is your ECS deployment setup safe enough?
Tick each item that is true today.
- The deployment circuit breaker is on with rollback enabled.
- The healthy minimum stops a deploy from removing capacity you need.
- The load balancer health check tests the database, not just the process.
- An alarm on errors or latency can fail a deployment without a person.
- Every migration works with both the old and the new code.
- You know which failures would justify moving to blue/green.
Decision point: Five or six ticks: rolling deployments are well covered. Three or fewer: fix these before adding blue/green, which will not rescue a weak health check.
How does canary compare with blue/green on ECS?
A canary deployment sends a small share of traffic to the new version first, and ECS supports canary and linear shifting natively or through CodeDeploy.
A canary deployment sends a small share of production traffic to the new version first, waits while you watch it, and only then moves the rest. AWS describes the ECS canary strategy as one that shifts a small percentage of traffic to the new service revision first, then shifts the remaining traffic all at once after a specified time period. In its worked example the first step is 10% to the new revision and 90% to the old one, and the second is 100% to the new one.
| Strategy | How traffic moves |
|---|---|
| Rolling | The scheduler replaces running tasks with new ones, within the limits you set |
| Blue/green | The new revision runs beside the old one and is checked with test traffic before production traffic goes to it |
| Canary | A small percentage first, then the remainder all at once after a set period |
| Linear | Equal percentage steps over a set period |
ECS supports canary and linear natively. AWS announced built-in linear and canary deployments on 30 October 2025, for new and existing services that use an Application Load Balancer or ECS Service Connect. You set a canary bake time to watch the new revision before the rest of the traffic moves, and a deployment bake time that keeps the old revision running before it is terminated. AWS says CloudWatch alarms can trigger a rollback automatically.
CodeDeploy offers the same idea through predefined configurations for ECS, including CodeDeployDefault.ECSCanary10Percent5Minutes, CodeDeployDefault.ECSCanary10Percent15Minutes, CodeDeployDefault.ECSLinear10PercentEvery1Minutes and CodeDeployDefault.ECSLinear10PercentEvery3Minutes. AWS notes that with a Network Load Balancer under CodeDeploy only the all-at-once configuration is supported.
The trade-offs are the ones AWS lists for canary: both versions run at the same time, which increases resource use, you have to compare metrics between two versions, and the deployment takes longer. In our judgement, a canary only helps if there is enough traffic and a useful alarm to tell a good canary from a bad one, and because two versions run together, every database change must work with both. For most small teams the rolling setup above, with the circuit breaker and alarms, is still the place to start.
Sources
- AWS docs, Amazon ECS blue/green deployments (checked November 2026)
- AWS docs, Amazon ECS rolling update deployments (checked November 2026)
- AWS, Amazon ECS enables built-in blue/green deployments (17 July 2025)
- AWS docs, Amazon ECS canary deployments (checked November 2026)
- AWS docs, Amazon ECS service deployment controllers and strategies (checked November 2026)
- AWS, Amazon ECS now supports built-in linear and canary deployments (30 October 2025)
- AWS docs, CodeDeploy deployment configurations (checked November 2026)
Keep reading
Keel is an AWS release and recovery operations service for SaaS teams of 3 to 15 developers, provided by Bargainn Services Ltd, a UK company registered at Companies House (16497746). Registered office: 3rd Floor, 86-90 Paul Street, London, EC2A 4NE, United Kingdom.