Linear deployment strategy

5 minutes 5 Questions

Linear deployment strategy is a gradual rollout approach used in AWS CodeDeploy and other deployment services that shifts traffic to new application versions in equal increments over a specified time period. This strategy provides a controlled and predictable way to deploy updates while minimizing risk. In a linear deployment, traffic is transferred from the original version to the new version in predetermined percentages at regular intervals. For example, a Linear10PercentEvery10Minutes configuration would shift 10% of traffic to the new version every 10 minutes until 100% of traffic reaches the updated application. AWS CodeDeploy offers several predefined linear deployment configurations: 1. Linear10PercentEvery10Minutes - Shifts 10% of traffic every 10 minutes 2. Linear10PercentEvery1Minute - Shifts 10% of traffic every minute 3. Linear10PercentEvery2Minutes - Shifts 10% of traffic every 2 minutes 4. Linear10PercentEvery3Minutes - Shifts 10% of traffic every 3 minutes Key benefits of linear deployment include: - Predictable rollout timeline with known completion time - Gradual exposure of new code to production traffic - Ability to monitor metrics and application health at each increment - Easy rollback capability if issues are detected during deployment - Reduced blast radius compared to all-at-once deployments Linear deployments work exceptionally well with Lambda functions and ECS services. During the deployment, CloudWatch alarms can be configured to trigger automatic rollbacks if error rates or latency thresholds are exceeded. This strategy differs from canary deployments, which initially shift a small percentage of traffic, then complete the remaining shift in one step. Linear provides more granular control over the traffic shift process. For the AWS Developer Associate exam, understanding when to use linear versus canary versus all-at-once deployment strategies is essential. Linear is ideal when you need consistent, measurable progress throughout the deployment process with regular checkpoints for validation.

Linear Deployment Strategy - AWS Developer Associate Guide

What is Linear Deployment Strategy?

A Linear deployment strategy is a traffic-shifting approach used in AWS CodeDeploy and AWS Lambda that gradually shifts traffic to a new version of your application in equal increments over a specified period of time. Unlike all-at-once deployments, linear deployments provide a controlled, predictable rollout pattern.

Why is Linear Deployment Important?

Linear deployment is crucial for several reasons:

• Risk Mitigation: By shifting traffic gradually, you can detect issues early before they affect all users
• Controlled Rollout: Provides predictable, time-based traffic shifting that is easy to monitor
• Reduced Blast Radius: If problems occur, only a portion of traffic is affected
• Easy Rollback: Issues can be detected during incremental shifts, allowing for automatic or manual rollback
• Compliance Requirements: Some organizations require gradual deployments for regulatory purposes

How Linear Deployment Works

Linear deployment shifts traffic in equal portions at regular intervals:

1. Initial State: 100% of traffic goes to the original version
2. First Increment: A fixed percentage shifts to the new version
3. Subsequent Increments: Equal percentages shift at each interval
4. Completion: 100% of traffic reaches the new version

AWS Linear Deployment Configurations:

For Lambda:
• Linear10PercentEvery10Minutes - Shifts 10% every 10 minutes
• Linear10PercentEvery1Minute - Shifts 10% every 1 minute
• Linear10PercentEvery2Minutes - Shifts 10% every 2 minutes
• Linear10PercentEvery3Minutes - Shifts 10% every 3 minutes

For ECS:
• Linear10PercentEvery1Minutes
• Linear10PercentEvery3Minutes

Linear vs Canary Deployment

Understanding the difference is essential for exam success:

• Linear: Equal increments at regular intervals (e.g., 10% every 10 minutes)
• Canary: Two-step process - small percentage first, then remainder (e.g., 10% initially, then 90% after validation)

Implementation with AWS SAM

In your SAM template, specify the deployment preference:

DeploymentPreference:
  Type: Linear10PercentEvery10Minutes
  Alarms: [list of CloudWatch alarms]
  Hooks: PreTraffic and PostTraffic Lambda functions

Exam Tips: Answering Questions on Linear Deployment Strategy

1. Recognize Keywords: Look for phrases like "equal increments," "gradual shift," "regular intervals," or "predictable rollout" - these indicate linear deployment

2. Know the Naming Convention: AWS linear configurations follow the pattern LinearXPercentEveryYMinutes - memorize common values

3. Differentiate from Canary: If the question mentions a small initial test followed by full deployment, that is Canary, not Linear. Linear uses consistent, equal increments throughout

4. Time Calculations: Be prepared to calculate total deployment time. For Linear10PercentEvery10Minutes, full deployment takes approximately 100 minutes (10 intervals)

5. Service Context: Remember that linear deployment is available for Lambda and ECS through CodeDeploy, not for EC2 in-place deployments

6. Rollback Triggers: Know that CloudWatch alarms can trigger automatic rollbacks during linear deployments

7. Hooks Understanding: PreTraffic and PostTraffic hooks can run validation tests during linear deployments

8. Use Case Matching: When a scenario requires steady, predictable traffic shifting over time with consistent monitoring windows, linear deployment is the answer

9. Blue/Green Relationship: Linear deployment is a type of blue/green deployment strategy - it uses alias shifting between Lambda versions

10. SAM Integration: Questions about serverless deployments with gradual rollout typically involve AWS SAM DeploymentPreference settings
Test mode:
More Linear deployment strategy questions
28 questions (total)

Other Deployment concepts