EB is a PaaS (Platform as a Service) to quickly deploy and manage applications in AWS without worrying about the underlying infrastructure.
AWS Elastic Beanstalk
AWS Elastic Beanstalk is used deploy and scale applications and services
developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and Internet Information Services (IIS).
You can simply upload your code, and AWS Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, and auto scaling to application health monitoring.
- EB supports many programming languages.
- It fits best to provision an environment with little admin overhead but not good for low-level infrastructure control.
- EB can host multiple different versions in separate URLs.
- It monitors application health via a health dashboard.
- It can only be used to deploy application to the AWS cloud. It is not used to deploy application on-premise environment.
Key architecture components of Elastic Beanstalk
- An application is a logical collection of Elastic Beanstalk Components such as environments, versions, and environment configurations.
- You can think of the application as a container or a package.
- An application version refers to a distinct iteration of an application that’s packaged into a bundle. It points to an S3 object that contains the deployable code.
- An environment is a collection of AWS resources running a specific application version.
- Each environment runs only one application version at a time.
EB Deployment Types
All at once
- Deploy the new version to all instances simultaneously.
- Quick and simple, not recommended for production
- Split instances into batches and deploy one batch at a time to the existing instances
Rolling with additional batch
- Deploy the new version in batches, but the first batch is deployed to the newly created instances to ensure full capacity during the deployment process.
- Once the first batch is successfully deployed in a new environment, all existing instances will be deployed in batch.
- Immutable environment updates are an alternative to rolling updates.
- Deploy the new version to a new single instance. Once succeeded, a new fleet of instances is created and deployed. At the same time, old instances are terminated accordingly.
- Deploy the new version to new instances and temporarily split traffic between the new version and the old version.
- Maintain two environments and swap CNAME after deployment