Topic lessonTopic: CI/CD design: from checks to release and recovery
AWS deployment strategies: ECS rolling, blue/green and canary compared
A deployment strategy defines how execution and user traffic move to a new version. Rolling replaces execution units; blue/green prepares parallel revisions; canary starts with a small share of traffic. Compare coexistence and stop conditions using a fictional ECS application.
Distinguish task replacement from traffic shifting and choose using version coexistence, shared data, capacity and stop conditions.
An artifact is the output to deploy. ECS schedules and updates containers; a task is an application execution unit. Fargate provides AWS-managed execution infrastructure, and an ALB routes HTTP requests. No live account is required.
D1: what changes when application A becomes B?
D1 is a fictional ECS/Fargate application behind an ALB, with a shared database. A is current; candidate B changes presentation only. The case explicitly assumes verified read/write compatibility for both versions. A/B are teaching labels, not real image references or digests.
- Users → ALBRequests
- ALB → App A: 90%90% to A
- ALB → App B: 10%10% to B
- App A: 90% → Shared databaseA reads/writes
- App B: 10% → Shared databaseB reads/writes
- Users
- Send business requests.
- ALB
- Route requests.
- App A: 90%
- Old version remains active.
- App B: 10%
- Validate a small traffic share.
- Shared database
- Requires old/new compatibility.
The diagram illustrates D1’s chosen traffic split, not live progress or measurements. Ten percent of tasks is different from ten percent of traffic. An ALB target group groups destinations; a configured split is not a guarantee that every user is assigned a fixed version or an exact measured share. Review session and connection behavior too.
Compare coexistence and the unit of change
| Strategy | What changes | Conditions to check |
|---|---|---|
| Rolling | Replace old tasks within the service in batches. | Version coexistence, startup/health and replacement capacity. |
| Blue/green | Prepare a parallel revision, validate, then switch traffic. | Parallel resources, test traffic and old-version retention. |
| Canary | Send a small traffic share to the new revision, then shift the rest after a wait. | Observations at the small share, decision criteria and a recovery target. |
| Linear | Increase the new revision’s traffic share by equal increments. | Waits/checks per step and the final post-shift observation period. |
The ECS documentation checked on 2026-10-25 lists ROLLING, BLUE_GREEN, LINEAR and CANARY under the ECS controller. ECS blue/green does not universally require CodeDeploy. A CodeDeploy controller with AppSpec and task sets is a separate configuration. This lesson uses native ECS strategies with an ALB.
Check capacity and shared state before shifting
| Setting | Calculated bound | Meaning |
|---|---|---|
| desiredCount=4; minimumHealthyPercent=100 | Minimum four healthy tasks | Capacity is needed to start replacements before stopping healthy old tasks. |
| maximumPercent=200 | Maximum eight tasks during deployment | Permits up to eight; does not promise eight tasks will launch. |
| maximumPercent=100; minimumHealthyPercent=100 | Maximum four; minimum four | A simple replacement of a healthy task has no room under these bounds; revisit settings and start/stop conditions. |
Official state wording differs: the developer guide includes STOPPING, while the API lists RUNNING/PENDING. Do not assume that beginning to stop immediately releases a slot; compare actual states, service events and applicable rules.
Two application revisions do not automatically create two isolated databases. If B writes data A cannot read, shifting traffic back to A may leave the failure in place. Check old/new compatibility during coexistence and after rollback, including caches, queues and external side effects.
For ECS linear deployments, distinguish waits between increments from bake time retaining both revisions after the full shift. Concurrent revisions can increase resource use and cost. Define retention and recovery before removing the old version or ending required observation.
At ten percent, what determines whether to continue?
Fictional policy D3 says not to increase B’s share after any observed incorrect business result. Supplied records show zero mismatches in 100 requests to A and eight in 100 to B; both return HTTP 200. HTTP success differs from business correctness, so D3 does not advance. These are teaching observations, not AWS defaults or live measurements.
| Observation | Decision | Next check |
|---|---|---|
| B returns incorrect business output | Stop expansion | Match B revision/configuration, inputs and expectations. |
| Requests to B were not identified | Insufficient evidence to advance | Identify which revision produced the observations. |
| Health checks pass; business output untested | Do not declare all conditions passed | Validate user operations and outcomes. |
| Traffic is shifted back to A | Recovery verification remains | Check configuration, data compatibility and user outcomes. |
The ECS circuit breaker detects deployment failures such as startup and health-check failures; its API and dedicated guide scope it to rolling deployments. Automatic rollback requires conditions including a prior COMPLETED deployment. It does not automatically recover every business defect or database state. Check alarms, hooks and rollback rules for the selected strategy.
Make a decision-ready plan before selecting the strategy
- Identify artifact, configuration, destination and intended change.
- Verify compatibility of shared databases, queues and other state.
- Separate task counts from traffic shares and plan concurrent capacity.
- Observe each revision and business results at small and full traffic shares.
- Define advance/stop conditions, authority and recovery boundaries.
- Verify user outcomes after release; use the recovery lesson to distinguish states to restore.
Check the unit of change and decision conditions
Choose an option to see the result and explanation.
Check, then explain in your own words
- Explain D1’s A/B applications and shared database.
- Distinguish task replacement from traffic shares.
- Check D2 bounds and D3’s stop decision.
- Identify state that remains after application rollback.
Check your understanding: D2 has desired count four, minimum 100% and maximum 100%. Can it simply replace one healthy task while preserving all four?
These bounds leave no room for that simple replacement: starting one first exceeds four, while stopping one first falls below four. Revisit settings, capacity and the applicable start/stop conditions.
Interpret percentages by their denominator and the particular upper or lower bound they define.
Sources and conditions checked
The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.
Scope and conditionsDistinguish native ECS strategies from the CodeDeploy controller. Documentation review, not live AWS/database validation.
Used in this lessonCompare coexistence and the unit of change
Scope and conditionsSeparate service revisions, test traffic, managed shifting and old-revision cleanup after bake time; resources and permissions are required. Documentation review, not live AWS/database validation.
Used in this lessonCompare coexistence and the unit of change
- Amazon ECS: Linear deploymentsChecked:
Scope and conditionsEqual traffic increments, step waits versus post-shift bake time, and concurrent old/new capacity. Documentation review, not live AWS/database validation.
Used in this lessonCompare coexistence and the unit of change Check capacity and shared state before shifting
Scope and conditionsCodeDeploy-specific task sets, AppSpec and traffic shifts; not universal requirements for native ECS. Documentation review, not live AWS/database validation.
Used in this lessonCompare coexistence and the unit of change
Scope and conditionsRolling task-count bounds and rounding, strategy-specific settings and circuit-breaker scope. Documentation review, not live AWS/database validation.
Used in this lessonCheck capacity and shared state before shifting At ten percent, what determines whether to continue?
Scope and conditionsRead/write compatibility during coexistence and after rollback; original author’s article now served through Builder Center. Documentation review, not live AWS/database validation.
Used in this lessonCheck capacity and shared state before shifting
Scope and conditionsRolling startup/health failures and prior COMPLETED target; not a guarantee of business correctness or database recovery. Documentation review, not live AWS/database validation.
Used in this lessonAt ten percent, what determines whether to continue?
Scope and conditionsKnown-good recovery versus explicit fix-forward conditions, small changes and recovery planning. Documentation review, not live AWS/database validation.
Used in this lessonMake a decision-ready plan before selecting the strategy
Scope and conditionsRUNNING/STOPPING/PENDING in maximum-count guidance and the API wording difference; stopping alone is not proof of released capacity. Documentation review, not live AWS verification.
Used in this lessonCheck capacity and shared state before shifting