In this session, we introduce you to a solution for easily running a Docker-powered microservices architecture on AWS using Elastic Beanstalk. We will also cover the fundamentals of Elastic Beanstalk and how it benefits developers looking for a quick and scalable way to get their applications running on AWS with no infrastructure work required. In the second half of the session Sean O’Brien, engineer at Prezi, will share how Prezi is using Elastic Beanstalk to build microservices for its entire development team.
Building a microservices architecture using Docker can require a lot of work, from launching and operating the underlying infrastructure to installing and maintaining cluster management software. With AWS Elastic Beanstalk’s multicontainer support feature, many of these tasks are simplified and abstracted away so you can focus on your application code. AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker. Elastic Beanstalk leverages Amazon EC2 Container Service for its container management capabilities.
AWS DevDay San Francisco, June 21, 2016.
Presenter: Adhiraj Singh, Sr. Product Manager
3. Agenda
• Elastic Beanstalk vs DIY
• How to use Elastic Beanstalk
• Multi-Container Docker with AWS Elastic Beanstalk
• Recently added features
• Customer Feature - Sean O’Brien (Prezi)
4. Developer Challenges
• Complexity of deploying code, provisioning
and managing infrastructure
• Expertise and time needed to manage and
configure servers, databases, load
balancers, firewalls, and networks
• How to automate application scaling
5. What is Elastic Beanstalk?
AWS Elastic Beanstalk is an easy-to-use service for
deploying and scaling web applications and services.
6. AWS Elastic Beanstalk vs. Do It Yourself
Your code
HTTP Server
Application Server
Language Interpreter
Operating System
Host
Elastic Beanstalk configures each
EC2 instance in your
environment with the components
necessary to run applications for
the selected platform.
Focus on building your
application
Provided by you
Provided and managed by AWS Elastic Beanstalk (EB)
On-instance configuration
7. AWS Elastic Beanstalk vs. Do It Yourself
• Preconfigured Infrastructure
• Single Instance (Dev, Low Cost)
• Load Balanced, Auto Scaling (Production)
• Web & Worker tiers
• Elastic Beanstalk provisions necessary
infrastructure resources such as the load
balancer, auto scaling group, security
groups, database (optional), etc.
• Provides a unique domain name for your
application
(e.g.: youapp.regionx.elasticbeanstalk.com)
Infrastructure stack
8. Common Use Cases
• Websites
• API backends
• Mobile backends
• Asynchronous workers
10. Elastic Beanstalk Benefits
Fast & simple
to begin
Developer
productivity
Impossible
to outgrow
Complete
resource control
No additional charge to use.
You only pay for underlying AWS resources (i.e.: EC2 instances, S3, etc.)
12. Information required to deploy application
01
02
03
04
Region
Stack (container) type
Single Instance
Load Balanced with
auto-scaling
OR
Database (RDS) Optional
Your code
Supported Platforms
13. Building applications with Elastic Beanstalk
Service Repos:
/myapp
/myapp/browserClient
/myapp/browserServer
/myapp/androidUI
/myapp/api
/myapp/notifications
/myapp/adminPortal
Application: api
Environment
prod-api V1
Environment
dev-api V1.1
Environment
browserClient V2
Environment
browserClient V2.1
Environment
dev-api V1.2
Environment
browserClient V3
Application: browser
14. How to deploy applications
1. Via AWS Management Console
2. Via AWS Toolkit for Eclipse and Visual
Studio IDE
3. Via AWS SDK’s and CLI
4. Via EB command line interface
$ eb deploy
15. Deploy Sample Application (EB CLI)
Initial application deployment workflow
$ git clone
https://github.com/awslabs/eb-
node-express-sample.git
Download sample application02
$ eb init
Create your Elastic Beanstalk app03
Follow the prompts to configure the
environment
04
05 Create the resources and launch the
application
$ eb create
$ pip install --upgrade awsebcli
Install the AWS Elastic Beanstalk
command line interface (EB CLI)
01
16. Update Sample Application (EB CLI)
Update application workflow
Update your code01
$ git add .
$ git commit –m “v2.0”
$ eb deploy
Add & commit code to repository02
Open application once deployment
completes.
03
$ eb open
19. Multi Container: Architecture
• Each environment has its own ECS Cluster
• Supports a single ECS Task definition per environment
• The ECS Task is defined in the Dockerrun.aws.json file
• Uses a flood scheduling mechanism
• Provides out of the box auto scaling for ECS Tasks
Elastic Beanstalk Environment
Auto Scaling Group / ECS Cluster
Instance 1 Instance 2
app1.elasticbeanstalk.com
Elastic Load
Balancing
Container 2Container 1
Container 3
Container 2Container 1
Container 3
21. Multi Container with Elastic Beanstalk : Demo
Nginx Proxy Example
Code at: https://github.com/awslabs/eb-docker-nginx-proxy
22. Benefits of using Multi-Container Docker with
Elastic Beanstalk
• Automation of capacity provisioning, load balancing,
scaling, and application health monitoring
• One stop management of your application in an
environment that supports range of services that are
integrated with Elastic Beanstalk, including but not
limited to VPC, RDS, and IAM.