Skip to main content

Elastic Beanstalk

EB

Let you deploy your application without you having to worry about allocating the servers. You just need to worry about writing the code.

It also automatically handle capacity provisioning, load balancing, scaling, and application health monitoring.

To update your application you can upload the files via console or CLI.

Applications can be Docker container, NodeJS, Java, PHP, Ruby, Python & Go. You can choose server to deploy via Apache or Nginx

Deployment strategy
  • All at once: If you plan 20 EC2 instances in total, all at once strategy will just deploy those 20 instances. The down side is that your applications won't be responding to request while you are deploying to those 20 instances.
  • Rolling: Deploy application to a batch at a time. Say a batch consist of 10 instances, that means with 20 instances, you will do 2 batches of deployment. Your application will still be responding which is good
  • Immutable: Variation of all at once, but when you deploy a new application to those 20 instances, you will deploy another 20 instances, so 40 in total temporarily, and then terminate those old 20 instances. Your application will still be up without any downtime
  • Blue-green deployment: Blue environment, green environment. Blue you can say is for development environment, and green is production environment, or the other way. When your development environment is ready for production you just toggle it to become production environment. The old production environment will become the new development environment. No downtime is involved.

Lab: Deploying a Highly Available and Fault Tolerant NodeJS Server

Head to Beanstalk, give your application a name. Pick a platform, what kind of application you are deploying, is it NodeJS, Python, Docker container, ... etc.

You can use a sample application or upload your code. Then you can configure if it is highly available or fault tolerant, before you deploy it.

Configure have load balancer and auto scaling if you configure it.

Deleting the beanstalk instance will delete all of the resources that are allocate with it.