Skip to content

ElasticBeanstalk Deployment Modes

Links: 102 AWS DVA Index


Deployment Modes

  • Single instance deployment is great for development environment whereas HA with load balancer is great for prod environments.
    • attachments/Pasted image 20220516115626.jpg
  • For deployments we upload zip files.

All at once

  • Everything is deployed in one go.
    • attachments/Pasted image 20220516120051.jpg
    • Grey means they were stopped.
  • It is the fastest.
  • In this update application won't be running during the update. This means application has downtime.
  • Great for quick iterations in development environment.
  • No additional cost.
This is the only deployment which has downtime.

Rolling

  • In this update application will be running below capacity during the update.
    • attachments/Pasted image 20220516120345.jpg
  • We can set the bucket size.
    • If you set a small bucket size and you have a lot of instances then it will be a very long deployment.
  • During some point in the update the application will be running both versions simultaneously.
  • No additional cost.

Rolling with additional batches

  • In this update application will be running at (full) capacity during the update.
    • attachments/Pasted image 20220516120807.jpg
  • In this also we can set the bucket size.
  • During some point in the update the application will be running both versions simultaneously.
  • Small additional cost.
  • Additional batch is removed at the end of the deployment.
  • Longer deployment.
  • Good for production.
If the question mentions full capacity then go with rolling with additional batches over rolling deployment.

Immutable

  • New Code is deployed to new instances on a temporary ASG.

    • At first in the new ASG only one instance is launched to see if it works and passes the health check. If all the health checks are passed then it launches the other instances.
    • attachments/Pasted image 20220516121152.jpg
  • Zero downtime.

  • High cost, double capacity.
  • Longest deployment.
  • Quick rollback in case of failures (just terminate new ASG)
  • Great for production.
  • New ASG is created.
If asked to choose between immutable and rolling with additional batches deployment type for production then select immutable since roll back is quick.

Blue/Green

  • Not a direct feature of Elastic Beanstalk
  • Zero downtime and release facility.
  • Create a new "stage" environment and deploy v2 there.
    • attachments/Pasted image 20220516121842.jpg
  • The new environment (green) can be validated independently and roll back if there are issues.
  • Route 53 can be setup using weighted policies to redirect a little bit of traffic to the stage environment.
  • Using Beanstalk, swap URLs when done with the environment test.
All in all it is a very manual process.
This is the only deployment with DNS change.

Canary Testing

  • New application version is deployed to a temporary ASG with the same capacity.
    • attachments/Pasted image 20220516122253.jpg
  • A small % of traffic is sent to the temporary ASG for a configurable amount of time
  • Deployment health is monitored
  • If there's a deployment failure, this triggers an automated rollback (very quick)
  • No application downtime
  • New instances are migrated from the temporary to the original ASG Old application version is then terminated.
Difference between Canary testing and Blue/Green deployment strategies.
  • Fully automated
  • Uses ALBs for weighted routing instead of Route53

Summary

attachments/Pasted image 20220516122709.jpg

Deployment modes of immutable and traffic splitting (blue/green or canary) are very expensive.
Don't use canary for EBS since it is not mentioned in the summary. Canary is more for lambda.

Last updated: 2023-02-18