Deployment Using AWS Elastic Beanstalk
What is AWS Elastic Beanstalk?
- It is an AWS service which makes it easier for developers to deploy and manage their application on AWS cloud without having to learn about the infrastructure that runs those applications.
- Developer just have to create his application, and simply uploads it on elastic beanstalk, and elastic beanstalk will automatically handle the details of capacity provisioning, load balancing, scaling, and application health monitoring.
- Elastic Beanstalk supports applications developed in Go, Java, .NET, Node.js, PHP, Python, and Ruby.
- User can interact with elastic beanstalk using Elastic Beanstalk console, the AWS Command Line Interface (AWS CLI), or eb.
Features of Elastic Beanstalk
- Wide Selection of Application Platforms : You can choose from variety of application platforms such as Java, .NET, Node.js, PHP, Ruby, Python, Go, and Docker to deploy your web applications.
- Variety of Application Deployment Options : Developer can deploy his code through the AWS Management Console, Elastic Beanstalk Command Line Interface, Visual Studio, and Eclipse.
- Monitoring : Elastic Beanstalk Health Dashboard allows you to visualize overall application health and customize application health checks, health permissions, and health reporting in one unified interface.
- Management and Updates : You can choose to have AWS Elastic Beanstalk automatically update to the latest version of your Elastic Beanstalk environment using Managed Platform Updates.
- Customization : Developer can customize or edit the configurations of provided to the application by Elastic Beanstalk.
- Scaling : Elastic beanstalk automatically scales up the resources assigned to our application according to its needs.
Components of AWS Elastic Beanstalk
- Application : Its similar a folder that contains components like environments, version and environment configuration.
- Application Version : It refers to a different versions of our deployed code.
- Environment : You can deploy your code on different environments like development, production or testing etc.
- Environment Tier : Are of two types –
- Web Server Tier : Serves HTTP requests
- Worker Tier : Handle background tasks.
- Platform : Combination of all the AWS Beanstalk components, an Operating system, a programming language runtime, and a web server to run the applications
Architecture of Web Server Environment
- Environment : It’s a bold blue outer line in the diagram. An environment is a heart of our application where we deploy our application. AWS resources created for an environment include one elastic load balancer (ELB in the diagram), an Auto Scaling group, and one or more Amazon Elastic Compute Cloud (Amazon EC2) instances.
- Elastic Load Balancer : It is linked to our environment via CNAME(simply a url given to every environment). When our application receives lots of request , it distributes all the requests among different EC2 instances, so that all requests are handled.
- Auto Scaling Group : When there is a lot of traffic in the environment and there is a scarcity of EC2 instances, then elastic beanstalk automatically adds EC2 instance. And if traffic is low , it automatically terminates few EC2 instances.
- Host Manager : Software that runs on every EC2 instance. Responsible for providing details regarding the performance of instance, and monitors log files as well.
- Security Group : So that not anyone could access your EC2 instance(Normally port 80 is available but you can edit the security group).
Architecture of Worker Environment
In this client sends a request to a server , the web server passes this request to the SQS(Simple Queue Service) . The SQS sends message to the worker in form of HTTP post request. This message is then processed with the help of a tool called daemon. After handling with the request, the worker responds back with the HTTP response.
How it works ?
- Create a local application of any platform
- Create an application in Elastic Beanstalk with an environment where you can upload your local application.
- Deploy it and use the URL provided for it to launch it.
Benefits of AWS Elastic Beanstalk
- Easy to start with : Just have to upload your application and elastic beanstalk will take care of everything.
- Autoscaling options : If your application’s traffic increases or decreases, beanstalk automatically scales it accordingly.
- Developer productivity : Developers don’t need to think much about uploading their application online, they only have to concentrate on keeping their application more secure and user friendly.
- Customization : User can simply customize the configurations provided to the application by beanstalk.
- Cost-effective : User just have to pay for the resources used.
- Management and updates : Easy to manage and update as user has full access over confirmation