EXAMTOPICS / TECHNOLOGY INSIGHTS

Amazon AWS DOP-C02: Blue-Green, Canary, Rolling, and Linear Deployments on AWS

Blue-green, canary, rolling, and linear deployments all reduce the risk of changing production, but they control risk in different ways. Rolling replacement limits how much capacity changes at once. Blue-green creates a parallel environment and switches traffic after validation. Canary sends a small portion of production traffic to the new version before broad rollout. Linear deployment increases the new version’s traffic in equal steps over time.

The strategy belongs to the workload, not to a diagram. Amazon ECS, AWS Lambda, EC2-based systems, and CodeDeploy support different mechanisms and constraints, so a release design should start with rollback requirements, health signals, blast radius, capacity cost, and state compatibility. These trade-offs are central to AWS DevOps Engineer – Professional DOP-C02.

Rolling deployment changes capacity incrementally

A rolling deployment replaces old application capacity with new capacity in batches. On Amazon ECS, rolling is the default deployment strategy for many services. The scheduler starts new tasks and stops old tasks according to the service’s deployment configuration, which controls how much healthy capacity must remain and how far total running capacity may temporarily rise.

Rolling updates are attractive because they do not require two complete production environments. They work well when the application can tolerate old and new versions running at the same time, health checks reliably detect bad instances or tasks, and rollback can replace the new version with the previous one quickly enough.

The main risk is mixed-version operation. During the rollout, some requests may reach the old version while others reach the new version. Database schemas, message formats, cache keys, and APIs therefore need backward and forward compatibility across the deployment window. A “small” code change can still become a large incident if the new version writes data the old version cannot read.

Blue-green keeps the old environment intact while the new one is validated

A blue-green deployment runs the current production environment and a replacement environment side by side. The green environment receives the new release and can be tested before production traffic is switched. If the new version fails after cutover, traffic can often return to blue faster than rebuilding the old version from scratch.

The trade-off is additional capacity and orchestration. For a period, both environments exist. Load balancers, target groups, permissions, service discovery, data dependencies, and deployment hooks must be designed so the green environment can be validated without accidentally affecting production state.

Blue-green works especially well when rollback speed matters and the platform can duplicate the serving layer. It does not automatically solve database rollback. If green runs a destructive schema migration, sending traffic back to blue may not restore compatibility. Application and data-release strategy still have to be coordinated.

Canary deployment tests a small production slice first

A canary deployment shifts a small percentage of production traffic to the new version, holds that exposure long enough to observe behavior, and then moves the remaining traffic if the canary is healthy. The blast radius is intentionally limited: a defect can affect real traffic, but only a controlled fraction at first.

Canary releases depend heavily on meaningful telemetry. Error rate, latency, saturation, business transaction success, and application-specific signals should be compared with the stable version. If the monitoring window is too short or the signal does not represent the risky behavior, the deployment may “pass” even though the canary never exercised the failure condition.

Current Amazon ECS documentation includes canary as a native ECS deployment strategy, alongside rolling, blue-green, and linear. CodeDeploy also supports traffic-shifting patterns for ECS and Lambda. That current capability matters because older material may imply that canary behavior always requires the older CodeDeploy-managed ECS pattern.

Linear deployment increases exposure in controlled steps

Linear deployment moves traffic to the new version in equal increments over time. Instead of 10 percent followed by an immediate jump to 100 percent, a linear policy might increase traffic repeatedly, allowing metrics to be observed between steps. The exact percentages and intervals depend on the platform and configuration.

This strategy is useful when gradual evidence matters more than the fastest possible cutover. It gives operators multiple observation windows and limits the size of each traffic increase. It can also take longer than a simple blue-green switch, which means two versions and their supporting resources coexist for a longer period.

Linear and canary strategies are both forms of progressive delivery, but they express different risk assumptions. Canary asks, “Can a small sample prove enough to release the rest?” Linear asks, “Can we keep increasing exposure only while each step remains healthy?”

The same strategy behaves differently on ECS, Lambda, and EC2

On ECS, deployments operate on service revisions and task sets, and load balancing or Service Connect may participate in traffic shifting depending on the strategy. Container architecture also affects the decision. A team comparing ECS and EKS deployment platforms should treat release control as part of the operational model rather than assuming every container orchestrator exposes identical primitives.

Lambda uses versions and aliases to support weighted traffic shifting. A serverless release can gradually route invocations to a new function version without managing instances. The underlying server capacity is AWS-managed, but application compatibility and monitoring remain customer responsibilities. This is one reason serverless application architecture changes the release mechanics without removing release risk.

EC2-based applications often use CodeDeploy or an Auto Scaling/image pipeline. In-place deployment updates instances in the existing group, while blue-green patterns provision replacement capacity. The instance image, bootstrap process, load balancer registration, and connection draining all influence how safely traffic moves.

Rollback design must include state, not only compute

A release mechanism can restore old application binaries quickly and still fail to restore service. Databases, queues, object formats, external APIs, feature flags, and background jobs may have changed during the deployment. Rollback is therefore an application consistency problem as much as a deployment-controller feature.

Safer releases use backward-compatible schema changes, expand-and-contract migrations, versioned messages, and feature flags when appropriate. A database change can be deployed before application behavior depends on it, then cleaned up after the older version is no longer needed. This preserves the ability to send traffic backward during the risky portion of the release.

Immutable machine or container artifacts help too. If rollback means “redeploy the exact previous image digest” rather than “re-run yesterday’s build,” recovery becomes more predictable. EC2 teams can strengthen this model with automated image deployment.

Deployment alarms should evaluate user impact, not just process completion

A deployment controller can know that a task started successfully without knowing that customers can complete a purchase, authenticate, or receive a valid API response. Health checks and alarms should therefore include application and business signals in addition to infrastructure state.

Canary and linear strategies especially depend on this evidence because their safety comes from observing partial traffic before increasing exposure. Blue-green needs validation before cutover and strong post-cutover monitoring. Rolling deployments need health checks that stop or reverse replacement when new capacity behaves badly.

Operationally, the best deployment pipeline links release events to logs, metrics, traces, and alerts. A deployment should create a time marker that lets responders correlate a new error pattern with the exact release that introduced it. General cloud deployment practices become much more useful when they are backed by workload-specific telemetry.

Release frequency also changes the decision. A team deploying dozens of times per day benefits from strategies that are fully automated and backed by fast, high-signal checks; manual blue-green cutovers can become a bottleneck. A lower-frequency system with a costly outage may justify longer bake periods and parallel capacity. The deployment pattern should fit the organization’s ability to observe and respond, not only the runtime’s technical feature list. Progressive delivery is safest when the team can detect a regression before the next traffic step begins.

Choose by blast radius, rollback speed, and capacity economics

Use rolling replacement when mixed versions are safe, incremental capacity change is acceptable, and duplicating the whole environment would be unnecessarily expensive. Use blue-green when pre-cutover validation and rapid traffic rollback justify parallel capacity. Use canary when real production behavior must be sampled with the smallest practical blast radius. Use linear when risk should be reduced through multiple controlled exposure steps.

No strategy removes the need for testing, compatibility, or monitoring. A badly instrumented canary can be riskier than a well-tested rolling release. A blue-green deployment can still fail if the database is not backward compatible. A rolling deployment can be excellent for a stateless service but wrong for a stateful application that cannot tolerate mixed versions.

Whichever strategy is selected, test the deployment mechanism itself. A rollback path that has never been exercised is only an assumption, and a health alarm that has never stopped a bad release is only a configuration. Game days and controlled failure tests can validate both before a real production incident depends on them.

The reliable pattern is to choose the simplest release mechanism that meets the workload’s risk and recovery requirements, then make rollback and health evidence part of the design from the beginning. Deployment strategy is not a label on the final pipeline stage; it is the control system for how production absorbs change.

Data changes can determine whether a deployment is truly reversible. A blue-green or canary application release may roll back quickly, but an incompatible schema migration, irreversible queue message format, or destructive background job can make the old version unsafe. Use backward-compatible data transitions and observe both application and dependency health so the chosen deployment strategy preserves the rollback window it promises.