In the above diagram 4 instances running V1 version of code. When we try to deploy a new version of code using All at once model we do the following steps:
All instances are stopped and V2 version of code is deployed.
All instances are started back to serve a new code.
When/Why do you choose this deployment model?
Fastest Deployment
Application can have downtime
No Additional cost
Rolling
In the above diagram, we have 4 instances running V1 version of the code. When we try to deploy using Rollingmodel of deployment we do the following steps:
Stop some servers (Bucket Size).
Deploy code new version of code to stopped Instances
Start those Instances back
Repeat the same steps for rest of the Instances
Bucket size = No of server on which, you do not want your application to run when you are rolling out new versions
When/Why do you choose this deployment model?
Application can run below capacity
Application does not go down at any time
Both versions of code run simultaneously
No Additional cost
Rolling with Additional Batches
In the above diagram we have 4 instances running V1 version of the code. When we try to deploy using Rolling with Additional Batches model of deployment we do the following steps:
Stage 1: Create new server
Stage 2: Deploy code to new batch of Instances
Stage 3: Stop few Instances which are running older version of the code
Stage 4: Deploy new version of the code and start
Stage 5 and 6: Repeat step 3 and 4 with other set of Instances
Stage 7: Terminate additional batch of Instances
When/Why do you choose this deployment model?
Good for production as Application is running at Capacity
Ok to have small Additional cost
Ok to have Longer Deployment times
Immutable
In the above diagram, we have 2 instances running V1 version of the code. When we try to deploy using Immutable model of deployment we do the following steps:
Stage 1: BeanStalk will launch one instance in the ASG and check for the health of the server
Stage 2: If the instance works well then it will turn up multiple Instances
Stage 3: If these Instances looks good then BeanStalk will move all instances from Temp to Current ASG
Stage 4: Current ASG will remove old instances.
When/Why do you choose this deployment model?
High cost, double capacity
Quick rollback
Longest Deployment time
Great for production.
Blue/Green Deployment
Blue-Green Deployment is a direct feature of Elastic BeanStalk
Route 53 can be setup using weighted policies to redirect