INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

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.

What you will learn

Distinguish task replacement from traffic shifting and choose using version coexistence, shared data, capacity and stop conditions.

Prerequisite

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.

D1 intermediate state: 90% traffic to A and 10% to B
D1 intermediate state: 90% traffic to A and 10% to B1: Users — Requests — ALB. 2: ALB — 90% to A — App A: 90%. 3: ALB — 10% to B — App B: 10%. 4: App A: 90% — A reads/writes — Shared database. 5: App B: 10% — B reads/writes — Shared database12345UsersALBApp A: 90%App B: 10%Shared databaseD1 intermediate state: 90% traffic to A and 10% to B1: Users — Requests — ALB. 2: ALB — 90% to A — App A: 90%. 3: ALB — 10% to B — App B: 10%. 4: App A: 90% — A reads/writes — Shared database. 5: App B: 10% — B reads/writes — Shared database12345UsersALBApp A: 90%App B: 10%Shared database
  1. Users → ALBRequests
  2. ALB → App A: 90%90% to A
  3. ALB → App B: 10%10% to B
  4. App A: 90% → Shared databaseA reads/writes
  5. 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

Compare strategies for the same D1 app
StrategyWhat changesConditions to check
RollingReplace old tasks within the service in batches.Version coexistence, startup/health and replacement capacity.
Blue/greenPrepare a parallel revision, validate, then switch traffic.Parallel resources, test traffic and old-version retention.
CanarySend 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.
LinearIncrease 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

D2: rolling settings for a desired count of four
SettingCalculated boundMeaning
desiredCount=4; minimumHealthyPercent=100Minimum four healthy tasksCapacity is needed to start replacements before stopping healthy old tasks.
maximumPercent=200Maximum eight tasks during deploymentPermits up to eight; does not promise eight tasks will launch.
maximumPercent=100; minimumHealthyPercent=100Maximum four; minimum fourA 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.

D3 evidence and decisions
ObservationDecisionNext check
B returns incorrect business outputStop expansionMatch B revision/configuration, inputs and expectations.
Requests to B were not identifiedInsufficient evidence to advanceIdentify which revision produced the observations.
Health checks pass; business output untestedDo not declare all conditions passedValidate user operations and outcomes.
Traffic is shifted back to ARecovery verification remainsCheck 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

  1. Identify artifact, configuration, destination and intended change.
  2. Verify compatibility of shared databases, queues and other state.
  3. Separate task counts from traffic shares and plan concurrent capacity.
  4. Observe each revision and business results at small and full traffic shares.
  5. Define advance/stop conditions, authority and recovery boundaries.
  6. 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.

One of ten tasks runs B. Must B receive exactly ten percent of traffic?
Read the answer and reason

Answer: No; inspect traffic routing separately. · Execution-unit replacement differs from request routing.

Does every ECS blue/green deployment require CodeDeploy and AppSpec?
Read the answer and reason

Answer: No; distinguish native ECS from CodeDeploy. · Verify current support and the configuration-specific requirements.

D3 sees eight incorrect business results in 100 B requests, all HTTP 200. Advance?
Read the answer and reason

Answer: No; D3’s stop condition is met. · Separate successful responses from correct business outcomes.

B wrote database values A cannot read. Does shifting traffic back to A complete recovery?
Read the answer and reason

Answer: No; verify data compatibility and recovery boundaries. · Application rollback and database recovery are separate.

Check, then explain in your own words

  1. Explain D1’s A/B applications and shared database.
  2. Distinguish task replacement from traffic shares.
  3. Check D2 bounds and D3’s stop decision.
  4. 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.