Blue/Green Deployment in AWS

Applications developed are subjective for constant upgrading and updates. Developers roll out new features that are needed to be deployed on the environment. Deploying a new code/feature to a perfectly running application is a sensitive process, which can result in unexpected errors or complete breakdown in the worst case. To avoid such scenarios, the concept of Blue-Green was developed.

What is Blue-Green?

Blue-Green deployment is a deployment strategy, where we have another environment identical to production, and deployment is carried on this environment. The live environment is termed as ‘Blue’ and new identical environment is ‘Green’. Deployment is performed on the Green environment. If the deployment is successful and no errors are detected, then the traffic is shifted to ‘Green’. The biggest advantage of this deployment is no downtime. Application is up and running even in the deployment and the end user hardly get to know about the deployment.
In AWS, Blue-Green deployment is possible with CodeDeploy and Beanstalk.
CodeDeploy offers various configurations -
Once the deployment is completed on the Green fleet, tested and verified, the traffic is shifted to it. CodeDeploy then terminates the Blue Fleet.
Deployments are made automatic using this approach. If the ec2-instance is under autoscaling, and a new instance is launched as a scaling activity, the application is automatically deployed to that instance. This time codedeploy is triggered by autoscaling.
In this way, deployments can be done without any downtime using CodeDeploy. CodeDeploy is a really good service offered by AWS.