Amazon Elastic Beanstalk
Eberhard Wolff
Freelance Consultant/ Trainer
Head Technology Advisory Board
adesso AG
HISTORY & ORIGIN

Eberhard Wolff - @ewolff
History & Origin
! Amazon: cloud pioneer
! Original offerings
! EC2 Elastic Compute Cloud
! S3 Simple Storage Service
! Many other offerings
! E.g. databases, Map / Reduce …
! Foundation for many other services
Eberhard Wolff - @ewolff
Other Amazon Services
! Elastic Load Balancer
! Auto Scaling
starts new EC2 instances
! EBS: Elastic Block Storage
virtual hard disks
Eberhard Wolff - @ewolff
Elastic Beanstalk in a
Nutshell

Eberhard Wolff - @ewolff
Elastic Beanstalk in a
Nutshell
!  EC2 Server
Elastic Load Balancer
!  +Linux
Auto Scaling
!  +OpenJDK
!  +Tomcat
EC2 Server
EC2 Server
Linux
Linux
!  Scaling Elastic
...
OpenJDK
OpenJDK
Load Balancer /
Tomcat
Tomcat
Auto Scaling
!  Deploy artefacts
on S3
WAR
!  Can add database
S3
(RDS)
Eberhard Wolff - @ewolff
Programming Model
! OpenJDK + Tomcat
! Standard Java Programming Model
! Also supported: Python, PHP, Ruby,
Node.js (Linux), .NET (Windows
Server 2008R2)
Eberhard Wolff - @ewolff
Scaling / High Availability 
! Servers automatically started
! Auto Scaling
! Failed servers will be restarted
! Servers can run in several data
centers
Eberhard Wolff - @ewolff
TOOLS

Eberhard Wolff - @ewolff
Web Console
! Web UI
! Wizard to create new application
! + environment to run the application
on

Eberhard Wolff - @ewolff
DEMO: NEWS APPLICATION

Eberhard Wolff - @ewolff
News Application

Eberhard Wolff - @ewolff
News Application
Originally by
Bernhard
Lƶwenstein

Eberhard Wolff - @ewolff
News Application

āœ”
āœ”

(āœ”)

āœ”
Eberhard Wolff - @ewolff
News Application
āœ”

āœ”

āœ–
Spring

āœ”

Eberhard Wolff - @ewolff
News Application

Next slide

Eberhard Wolff - @ewolff
Code Changes
Took the Spring application
Converted to MySQL

<bean class="java.net.URI" id="dbUrl">	
<constructor-arg	
value="#{systemEnvironment['JDBC_CONNECTION_STRING']}" />	
</bean>	
	
<bean id="dataSource"	
class="org.apache.commons.dbcp.BasicDataSource">	
<property name="url"	
value="#{ 'jdbc:mysql://' + @dbUrl.getHost() + "	
':' + @dbUrl.getPort() + @dbUrl.getPath() }" />	
<property name="username"	
value="#{ @dbUrl.getUserInfo().split(':')[0] }" />	
<property name="password"	
value="#{ @dbUrl.getUserInfo().split(':')[1] }" />	
</bean>
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Eberhard Wolff - @ewolff
Some tricks...
! Easy to create a new environment
! E.g. for testing, staging
! URLs can be swapped

Eberhard Wolff - @ewolff
Some tricks...
! Deploy new version on new
environment
! Switch URLs with production
! Zero downtime
Eberhard Wolff - @ewolff
More tools
! All web console action also possible
using SOAP Web Services
! Command Line tools

Eberhard Wolff - @ewolff
Eclipse Plug In
! Manage all AWS resources (EC2,
S3…)
! Manage Elastic Beanstalk server just
like local servers

Eberhard Wolff - @ewolff
Eclipse Plug In

Eberhard Wolff - @ewolff
FLEXIBILITY

Eberhard Wolff - @ewolff
Flexibility
!  Tuning possible
!  E.g. JVM parameters
!  Load balancer configuration
!  Can even use your own system images
!  i.e. can add software, fine tune …
!  Can log into running servers
!  Session handling can be tuned
!  Use EC2 if Elastic Beanstalk not flexible
enough
Eberhard Wolff - @ewolff
Configuration Files
! Part of the deployable artifact
! Declaratively install packages &
libraries
! Configure software components
! Run commands
! Set environment variables
! Create users & groups
Eberhard Wolff - @ewolff
PLATFORM AND OTHER
SERVICES
Eberhard Wolff - @ewolff
Platform
!  Amazon Web Services
!  Proven foundation
!  Used for many other cloud plattforms
!  …and by many users
!  Includes monitoring
!  No additional charges to EC2 / S3
!  Free tier (750 h/month for one year)
available
Eberhard Wolff - @ewolff
Other Services
! Amazon Relational Database Service
! Oracle, MySQL, MS SQL Server
! Diverse NoSQL solutions
(e.g. DynamoDB, SimpleDB)
! Lots of AWS services (Map/Reduce,
Caches, Search etc)
! Other services provided by 3rd parties
Eberhard Wolff - @ewolff
Amazon Elastic Beanstalk:
Highlights
! Proven foundation
! Standard Java stack (Tomcat +
OpenJDK)
! World wide availability (incl.
Europe)
! Lots of additional services
Eberhard Wolff - @ewolff

Amazon Elastic Beanstalk