Deployment strategies define how you want to deliver your software.
Deployment Strategies – Introduction to DevOps on AWS (amazon.com)
Blue/Green Deployment
The Blue/Green deployment uses the 2 identical environments: 1 blue + 1 green.
- Blue: the current version of the application
- Green: the new version of the application
Process
- Live traffic to Blue and Test traffic to Green
- After testing is complete, live traffic is directed to Green.
- Blue becomes inactive.
Pros and Cons
- Fast Rollback: If something goes wrong with the new version (Green), you can roll back to the original version (Blue).
- Low-risk strategy, but cost is a major drawback since you need to replicate a production environment.
Rolling Deployment
Rolling deployment allows you to make your changes in batches and deploy to only a portion of the environment.
Process
- Set the batches and deploy the new version in batches.
Pros and Cons
- Cost-effective: you only maintain a single production environment.
- Mixed Environment: During the deployment, you have old and new versions of your application running side by side.
- Complex Rollback: If a deployment fails, you need to redeploy the old version.
Canary Deployment
Instead of having another full environment, canary deployments deploy just a small subset of servers or nodes with a new version. And then, you can see how the canary version works compared to the baseline production version before you can roll back or proceed to the rest of the environment in a linear fashion.
Process
- Deploy the new version to a small number of servers
- Direct a small proportion of traffic to the new version (e.g., 10~20%)
Pros and Cons
- Enabling canary testing with real customers
- Rollback to the old version or roll out the new version to everyone
- Early warning system for a mission-critical application