USD ($)
$
United States Dollar
Euro Member Countries
India Rupee
د.إ
United Arab Emirates dirham
ر.س
Saudi Arabia Riyal

Deployment Strategies

Lesson 14/50 | Study Time: 30 Min

Getting code through CI is only half the job. How you deploy that code to production matters just as much. Deploy poorly and you risk downtime, broken user experiences, and a painful rollback.

The three strategies — Blue/Green, Canary, and Rolling — each solve the deployment problem differently. Knowing when to use each one is an essential skill for any DevOps engineer.

The Core Problem Deployment Strategies Solve

Every deployment carries risk. Something that worked perfectly in staging can behave differently in production. The question is — how do you get new code live while protecting users from that risk?


The answer depends on three things:


1. How quickly you need to roll back if something goes wrong.

2. How much downtime is acceptable.

3. How much infrastructure you are willing to run simultaneously.

Blue/Green Deployment

You maintain two identical production environments — Blue (current live version) and Green (new version). You deploy the new version to Green, test it, and then switch all traffic from Blue to Green in one move.

If something goes wrong after the switch, you flip traffic back to Blue instantly — rollback takes seconds.

Key Characteristics


When to Use It


1. Applications that cannot tolerate any downtime.

2. When you need the safest, fastest rollback option available.

3. Database schema changes need careful handling — both environments must be compatible with the same database during the switch.


On AWS: AWS CodeDeploy, Elastic Beanstalk, and Amazon ECS all support Blue/Green deployments natively.

Canary Deployment

Instead of switching all traffic at once, you release the new version to a small percentage of users first — say 5% or 10%. You monitor closely. If everything looks healthy, you gradually increase the percentage until 100% of traffic is on the new version.


The name comes from the old mining practice of sending a canary into a mine to detect danger before sending people in.

Key Characteristics


When to Use It


1. When you want to test new features with real users before full rollout.

2. High-traffic applications where even a small percentage represents meaningful validation.

3. When you have good monitoring in place to catch problems quickly.


On AWS:  AWS CodeDeploy supports canary deployments with automatic rollback based on CloudWatch alarms. If error rates spike during the canary phase, CodeDeploy rolls back automatically without human intervention.

Rolling Deployment

You update instances one at a time — or in small batches — rather than all at once. At any given moment during the deployment, some instances are running the old version and some are running the new version.


Key Characteristics



When to Use It


1. When infrastructure cost is a concern and you cannot afford to run two full environments.

2. Stateless applications where running two versions at once does not cause issues.

3. Kubernetes environments — rolling updates are the default deployment strategy in Kubernetes.


On AWS: Amazon ECS, AWS Elastic Beanstalk, and Kubernetes on EKS all support rolling deployments out of the box.

Drew Collins

Drew Collins

Product Designer
Profile

Class Sessions

1- What is DevOps? Principles, Culture, and Practices 2- The DevOps Lifecycle 3- Introduction to Cloud Computing 4- AWS Global Infrastructure 5- Core AWS Services Overview 6- Git Fundamentals 7- Branching Strategies 8- Pull Requests and Code Review Best Practices 9- Integrating Git with AWS CodeCommit and GitHub 10- Managing Secrets and Sensitive Files in Repositories 11- What is CI/CD? 12- Building Pipelines with AWS CodePipeline and CodeBuild 13- Automated Testing in CI 14- Deployment Strategies 15- Using GitHub Actions and Jenkins on AWS 16- Why Infrastructure as Code (IaC)? 17- AWS CloudFormation 18- Terraform on AWS 19- AWS Cloud Development Kit (CDK) 20- IaC Best Practices 21- Docker Fundamentals 22- Amazon ECR 23- Deploying Containers with Amazon ECS 24- Kubernetes Basics and Amazon EKS 25- Integrating Containers into CI/CD Pipelines 26- Serverless Computing Concepts and Use Cases 27- Building and Deploying AWS Lambda Functions 28- Event-Driven Automation with Amazon EventBridge 29- Orchestrating Workflows with AWS Step Functions 30- API Gateway Integration for Serverless APIs 31- Introduction to MLOps 32- Training and Deploying Models with Amazon SageMaker 33- Automating ML Pipelines with SageMaker Pipelines 34- Using Amazon CodeWhisperer and AI Tools for Code Automation 35- AI-Powered Testing, Anomaly Detection, and Incident Prediction 36- Observability Fundamentals 37- Amazon CloudWatch 38- Distributed Tracing with AWS X-Ray 39- Centralised Logging with Amazon OpenSearch Service 40- Setting Up Automated Alerts and Incident Response Workflows 41- Shift-Left Security 42- IAM Roles, Policies, and Least-Privilege Access 43- Static Code Analysis and Vulnerability Scanning in CI/CD 44- AWS Security Hub, GuardDuty, and Config for Compliance 45- Secrets Management with AWS Secrets Manager and Parameter Store 46- AWS Well-Architected Framework 47- Auto Scaling and Elastic Load Balancing for Resilience 48- Cost Monitoring with AWS Cost Explorer and Budgets 49- Disaster Recovery Strategies 50- Preparing Your Project for Production