SlideShare a Scribd company logo
Dead-SimpleDeploymentHeadache FreeJava Web ApplicationsIn The Cloud
AbstractThe cloud has promised a lot to Java Web developers but has delivered on only some of the hype. Many issues still exist that have the ability to kill many a project. Elastic Beanstalk, a Web service announced by Amazon in early 2011, takes the cloud to the next level for Java Web applications. It aims to eliminate the remaining issues the cloud presents. No hardware purchases? Check! Low setup costs? Check! No software installation? Check! Automatic resource scaling? Check! Resource monitoring? Check! This presentation takes a deep dive into Amazon's Elastic Beanstalk service, including what problems it can help solve and opportunities it provides to deliver better Java Web applications.craigsdickson.com
Speaker BioCraig S. Dickson is a software engineering professional with over 15 years of experience. He has proven leadership experience in both domestic and multi-national start-up and Fortune 500 corporations in the United States, Australia and Europe. Craig specializes in enterprise Java development and cloud architecture and holds multiple certifications including Sun Certified Architect for JavaEE and Certified ScrumMaster. Craig brings specific expertise in enterprise software architecture and design, refining development processes and building development teams around Agile software engineering principles. Educated in Australia, Craig holds a BSc(Hons) in Computer Science. He is based in Huntington Beach, CA, and Brisbane, Australia. craigsdickson.com
Presentation OutlineWhat are the common problems related to developing and deploying a Java web app?How does Amazon Elastic Beanstalk (EB) attempt to address those problems?Do I have to change how I write my Java apps?What existing applications will work on EB?How much does EB cost?What are the alternatives to EB?craigsdickson.com
The Downsides of being an Enterprise Java EngineerTopiccraigsdickson.com
Early Stage DevelopmentGoal: isolated self-contained local development, quick code-test-code cyclesHow to demonstrate an individual’s work?How to demonstrate combined work?What about clients outside your firewall?How to push quick (automated) updates?craigsdickson.com
What about Test and Stage? Goal: quick, consistent, production-like environment provisioningEnough resources to set up 2 more environments?Enough resources to make them production-like?What if your testers are not local?A clean environment for each round of tests?Will QA get angry if I run performance tests?craigsdickson.com
What about Production?Goal: minimize cost, high availability, high reliability, monitoring, automated zero downtime upgradesHow do I migrate from staging to the production environment?What if it’s a success, how do I handle the traffic?What if it is a bomb, what do I do with all this hardware?It’s 2am, is my application up and running?The network card on one of my servers just died, how long will it take to replace?craigsdickson.com
How does Elastic Beanstalk address these problems?Topiccraigsdickson.com
What is Elastic Beanstalk?Platform-as-a-Service (PaaS) offering from Amazon Web Services (AWS)Built on top of existing AWS infrastructureLaunched January 2011, still officially BetaFirst (and currently only) supported application architecture is Java Web Applications on TomcatRuby rumored to be next language to be supportedcraigsdickson.com
PaaS on top of IaaScraigsdickson.com
EB Componentscraigsdickson.com
EB Runtime Architecturecraigsdickson.com
Elastic Beanstalk Management ConsoleDemocraigsdickson.com
Deploying Your First Elastic Beanstalk ApplicationDemocraigsdickson.com
Currently Supported PlatformsApplication ServersTomcat 6Tomcat 7OSAmazon Linux 32 and 64bit versionsRHEL / CentOS basedbinary compatibility with RHEL 5Only interesting if you intend to use SSHcraigsdickson.com
LoggingConfigured to use java.util.logging by defaultCan use a meta-framework like SLF4JStandard Tomcat logs are created (catalina.out etc)Can view snapshot of logs from management consoleCan be rotated out to S3 hourlyCan SSH to instances to view live logscraigsdickson.com
Database IntegrationEB does not directly manage your databasesCan use the Amazon SimpleDBCan also use Amazon RDSCan also use an RDBMS running on an Amazon EC2 instanceCan also use a non-Amazon based databasePass JDBC connection info to app through consolecraigsdickson.com
Monitoring and NotificationUses Amazon CloudWatch (CW) to monitor your environmentCan trigger scaling events based on metricscpu utilizationnetwork traffic, etc.EB adds a health check feature on top of CWMust have at least 1 URL that can be accessed without securityUses Amazon SNS to publish eventsscaling up / downhealth check failurescraigsdickson.com
Auto-ScaleBased on CW events, your environment can be scaled up or down automaticallyCan configure what CW events trigger scalingCan set minimum and maximum instance countsCan control up / down instance incrementAlso can control how scaling events are generatedcraigsdickson.com
Environment Hot SwapImagine you have an existing EB production environmentNow you have a new version ready to go live sitting in another EB environment (e.g. staging)EB supports URL Swappingstaging becomes production and production becomes stagingResults in zero application downtimecraigsdickson.com
Managing Elastic Beanstalk EnvironmentsDemocraigsdickson.com
How much do I have to change my development process?Topiccraigsdickson.com
Developing for EBJava WAR files onlyStick to the standard JavaEE rulesdon’t read/write the local file system etcCode for a clustered environmentConnections to external resourcesconfigure via AWS management consolecraigsdickson.com
Eclipse IntegrationEclipse plugin to integrate with EBCreate new Applications and Environments right from EclipseDeploy new Versions just by deploying to EB instead of a local TomcatFirst time deployment can take several minutesRapid code-test-code cycles should still be done locallyCareful about deleting the wrong environmentcraigsdickson.com
First Elastic Beanstalk Application in EclipseDemocraigsdickson.com
Locally Testing an Elastic Beanstalk Application in EclipseDemocraigsdickson.com
Deploying To Elastic Beanstalk from EclipseDemocraigsdickson.com
Command Line & Maven OptionsAll EB functions are available through a command line APIMaven plugin written by Aldrin Lealhttp://beanstalker.ingenieux.com.br/Wraps entire EB command line APIExcellent for faking EB support in other IDEs (Netbeans etc)Excellent for command-line builds, continuous integration (Jenkins) etccraigsdickson.com
Which of my Existing Applications will work on Elastic Beanstalk?Topiccraigsdickson.com
What applications work on EB?craigsdickson.com
Custom Amazon Machine Image (AMI)Category D applications from the previous slide, need / want to access local resources and/or filesJenkins is an excellent example of this typeNeeds Maven, Ant and other tools to be availableNeeds to write build logs, archive artifacts etcStart with base EB AMI, then customizeSpecify your own AMI ID in the Environment Configurationcraigsdickson.com
How much is it going to cost me?Topiccraigsdickson.com
Cost SourcesEB itself is FREE!Pay as you go - for all other AWS servicesEC2 for running environmentsS3 for storing the versions of the applicationElastic Load Balancer instance and data chargesEBS to back the EC2 instance plus for any custom AMIs you createOutbound trafficcraigsdickson.com
Example Price BreakdownAdapted from: http://aws.amazon.com/elasticbeanstalk/#pricingcraigsdickson.com
Are there alternatives toElastic Beanstalk thatI should consider?Topiccraigsdickson.com
VirtualizationCan’t I just get the same benefits with an in-house virtualization solution?Still need to setup the OS and Tomcat environment at least once.What about security and other updates?Can the in-house scale appropriately / automatically?craigsdickson.com
Other PaaS VendorsIsn’t this just the same thing that other PaaS vendors already do?EB allows low level system accessSome PaaS vendors are running on AWS infrastructure anywayIf you need more than a Tomcat environment right now, then other vendors may be the way to goJavaEE server, Ruby, PHP etccraigsdickson.com
SummaryAmazon Elastic Beanstalk is a PaaS solution built on top of the existing Amazon IaaS solutionsCurrently offers Tomcat 6 & 7 environmentsOften requires no modification to existing codeHas good tooling supportCan be extended through low-level system accessSolves many day-to-day problems for developerscraigsdickson.com
Next StepsSign up for an EB account and deploy the sample applicationhttp://aws.amazon.com/elasticbeanstalk/Join the EB community forumhttps://forums.aws.amazon.com/forum.jspa?forumID=86Check EB related resources on my bloghttp://craigsdickson.com/tag/elastic-beanstalk/craigsdickson.com
Questions?Craig S. DicksonEmail - craig@craigsdickson.comBlog - http://craigsdickson.comLinkedIn – http://bit.ly/csd-liTwitter – http://bit.ly/csd-twcraigsdickson.com
Ad

More Related Content

What's hot (7)

Webinar - Big Data: Let's SMACK - Jorg Schad
Webinar - Big Data: Let's SMACK - Jorg SchadWebinar - Big Data: Let's SMACK - Jorg Schad
Webinar - Big Data: Let's SMACK - Jorg Schad
Codemotion
 
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
European Collaboration Summit
 
Ryan Brown - Open Community
Ryan Brown - Open CommunityRyan Brown - Open Community
Ryan Brown - Open Community
ServerlessConf
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
Julien SIMON
 
The Rise of Serverless Architectures
The Rise of Serverless ArchitecturesThe Rise of Serverless Architectures
The Rise of Serverless Architectures
Benny Bauer
 
Architecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaSArchitecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaS
Estelle Auberix
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWS
Danilo Poccia
 
Webinar - Big Data: Let's SMACK - Jorg Schad
Webinar - Big Data: Let's SMACK - Jorg SchadWebinar - Big Data: Let's SMACK - Jorg Schad
Webinar - Big Data: Let's SMACK - Jorg Schad
Codemotion
 
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
ECS19 Anil Erduran and Ryan Pothecary - SQL Server On AWS RDS and Andamazone EC2
European Collaboration Summit
 
Ryan Brown - Open Community
Ryan Brown - Open CommunityRyan Brown - Open Community
Ryan Brown - Open Community
ServerlessConf
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
Julien SIMON
 
The Rise of Serverless Architectures
The Rise of Serverless ArchitecturesThe Rise of Serverless Architectures
The Rise of Serverless Architectures
Benny Bauer
 
Architecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaSArchitecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaS
Estelle Auberix
 
Continuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWSContinuous Integration and Deployment Best Practices on AWS
Continuous Integration and Deployment Best Practices on AWS
Danilo Poccia
 

Similar to Dead-Simple Deployment: Headache-Free Java Web Applications in the Cloud (20)

NWCloud Cloud Track - Best Practices for Architecting in the Cloud
NWCloud Cloud Track - Best Practices for Architecting in the CloudNWCloud Cloud Track - Best Practices for Architecting in the Cloud
NWCloud Cloud Track - Best Practices for Architecting in the Cloud
nwcloud
 
Practical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobus
Jarrod Overson
 
Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2
Volodymyr Tsap
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud service
Jeffray Huang
 
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | EdurekaAWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
Edureka!
 
Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!
Edward Burns
 
基于Aws的持续集成、交付和部署 代闻
基于Aws的持续集成、交付和部署 代闻基于Aws的持续集成、交付和部署 代闻
基于Aws的持续集成、交付和部署 代闻
Mason Mei
 
MongoDB on Windows Azure
MongoDB on Windows AzureMongoDB on Windows Azure
MongoDB on Windows Azure
MongoDB
 
Shipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howtoShipping logs to splunk from a container in aws howto
Shipping logs to splunk from a container in aws howto
Екатерина Задорожная
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
Helen Rogers
 
Elastic beanstalk
Elastic beanstalkElastic beanstalk
Elastic beanstalk
Parag Patil
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
Hosam Kamel
 
Developing Java Applications in AWS
Developing Java Applications in AWSDeveloping Java Applications in AWS
Developing Java Applications in AWS
Nemanja Kostic
 
McrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and AmazonMcrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and Amazon
Dan Lister
 
Architecting Cloud Apps
Architecting Cloud AppsArchitecting Cloud Apps
Architecting Cloud Apps
jineshvaria
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
Amazon Web Services Korea
 
Implementing Infrastructure as Code ConfigMgtCamp 2017
Implementing Infrastructure as Code ConfigMgtCamp 2017Implementing Infrastructure as Code ConfigMgtCamp 2017
Implementing Infrastructure as Code ConfigMgtCamp 2017
Kief Morris
 
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalkDistribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Amazon Web Services LATAM
 
Building REA In The Cloud
Building REA In The CloudBuilding REA In The Cloud
Building REA In The Cloud
Oracle
 
NWCloud Cloud Track - Best Practices for Architecting in the Cloud
NWCloud Cloud Track - Best Practices for Architecting in the CloudNWCloud Cloud Track - Best Practices for Architecting in the Cloud
NWCloud Cloud Track - Best Practices for Architecting in the Cloud
nwcloud
 
Practical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobusPractical WebAssembly with Apex, wasmRS, and nanobus
Practical WebAssembly with Apex, wasmRS, and nanobus
Jarrod Overson
 
Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2Immutable infrastructure tsap_v2
Immutable infrastructure tsap_v2
Volodymyr Tsap
 
Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015Best of Microsoft Dev Camp 2015
Best of Microsoft Dev Camp 2015
Bluegrass Digital
 
Java and windows azure cloud service
Java and windows azure cloud serviceJava and windows azure cloud service
Java and windows azure cloud service
Jeffray Huang
 
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | EdurekaAWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
AWS Elastic Beanstalk Tutorial | AWS Certification | AWS Tutorial | Edureka
Edureka!
 
Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!Sponsored Session: Please touch that dial!
Sponsored Session: Please touch that dial!
Edward Burns
 
基于Aws的持续集成、交付和部署 代闻
基于Aws的持续集成、交付和部署 代闻基于Aws的持续集成、交付和部署 代闻
基于Aws的持续集成、交付和部署 代闻
Mason Mei
 
MongoDB on Windows Azure
MongoDB on Windows AzureMongoDB on Windows Azure
MongoDB on Windows Azure
MongoDB
 
Aws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon ElishaAws-What You Need to Know_Simon Elisha
Aws-What You Need to Know_Simon Elisha
Helen Rogers
 
Elastic beanstalk
Elastic beanstalkElastic beanstalk
Elastic beanstalk
Parag Patil
 
Web development concepts using microsoft technologies
Web development concepts using microsoft technologiesWeb development concepts using microsoft technologies
Web development concepts using microsoft technologies
Hosam Kamel
 
Developing Java Applications in AWS
Developing Java Applications in AWSDeveloping Java Applications in AWS
Developing Java Applications in AWS
Nemanja Kostic
 
McrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and AmazonMcrUmbMeetup 22 May 14: Umbraco and Amazon
McrUmbMeetup 22 May 14: Umbraco and Amazon
Dan Lister
 
Architecting Cloud Apps
Architecting Cloud AppsArchitecting Cloud Apps
Architecting Cloud Apps
jineshvaria
 
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
20141021 AWS Cloud Taekwon - Startup Best Practices on AWS
Amazon Web Services Korea
 
Implementing Infrastructure as Code ConfigMgtCamp 2017
Implementing Infrastructure as Code ConfigMgtCamp 2017Implementing Infrastructure as Code ConfigMgtCamp 2017
Implementing Infrastructure as Code ConfigMgtCamp 2017
Kief Morris
 
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalkDistribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Distribua, gerencie e escale suas aplicações com o aws elastic beanstalk
Amazon Web Services LATAM
 
Building REA In The Cloud
Building REA In The CloudBuilding REA In The Cloud
Building REA In The Cloud
Oracle
 
Ad

More from Craig Dickson (13)

Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Craig Dickson
 
JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
Craig Dickson
 
How to test drive development using Linux
How to test drive development using LinuxHow to test drive development using Linux
How to test drive development using Linux
Craig Dickson
 
Google Wave Introduction
Google Wave IntroductionGoogle Wave Introduction
Google Wave Introduction
Craig Dickson
 
Adobe Flex 4 Overview
Adobe Flex 4 OverviewAdobe Flex 4 Overview
Adobe Flex 4 Overview
Craig Dickson
 
Palm WebOS Overview
Palm WebOS OverviewPalm WebOS Overview
Palm WebOS Overview
Craig Dickson
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief Overview
Craig Dickson
 
eHarmony in the Cloud
eHarmony in the CloudeHarmony in the Cloud
eHarmony in the Cloud
Craig Dickson
 
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-onFast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Craig Dickson
 
Building Social Applications using Zembly
Building Social Applications using ZemblyBuilding Social Applications using Zembly
Building Social Applications using Zembly
Craig Dickson
 
Cloud Computing Introduction
Cloud Computing IntroductionCloud Computing Introduction
Cloud Computing Introduction
Craig Dickson
 
Performance Analysis and Monitoring with Perf4j
Performance Analysis and Monitoring with Perf4jPerformance Analysis and Monitoring with Perf4j
Performance Analysis and Monitoring with Perf4j
Craig Dickson
 
JavaFX vs AJAX vs Flex
JavaFX vs AJAX vs FlexJavaFX vs AJAX vs Flex
JavaFX vs AJAX vs Flex
Craig Dickson
 
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and JackrabbitRapid RESTful Web Applications with Apache Sling and Jackrabbit
Rapid RESTful Web Applications with Apache Sling and Jackrabbit
Craig Dickson
 
JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)JDBC Basics (In 20 Minutes Flat)
JDBC Basics (In 20 Minutes Flat)
Craig Dickson
 
How to test drive development using Linux
How to test drive development using LinuxHow to test drive development using Linux
How to test drive development using Linux
Craig Dickson
 
Google Wave Introduction
Google Wave IntroductionGoogle Wave Introduction
Google Wave Introduction
Craig Dickson
 
Adobe Flex 4 Overview
Adobe Flex 4 OverviewAdobe Flex 4 Overview
Adobe Flex 4 Overview
Craig Dickson
 
Java Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief OverviewJava Persistence API (JPA) - A Brief Overview
Java Persistence API (JPA) - A Brief Overview
Craig Dickson
 
eHarmony in the Cloud
eHarmony in the CloudeHarmony in the Cloud
eHarmony in the Cloud
Craig Dickson
 
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-onFast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Fast and Free SSO: A Survey of Open-Source Solutions to Single Sign-on
Craig Dickson
 
Building Social Applications using Zembly
Building Social Applications using ZemblyBuilding Social Applications using Zembly
Building Social Applications using Zembly
Craig Dickson
 
Cloud Computing Introduction
Cloud Computing IntroductionCloud Computing Introduction
Cloud Computing Introduction
Craig Dickson
 
Performance Analysis and Monitoring with Perf4j
Performance Analysis and Monitoring with Perf4jPerformance Analysis and Monitoring with Perf4j
Performance Analysis and Monitoring with Perf4j
Craig Dickson
 
JavaFX vs AJAX vs Flex
JavaFX vs AJAX vs FlexJavaFX vs AJAX vs Flex
JavaFX vs AJAX vs Flex
Craig Dickson
 
Ad

Recently uploaded (20)

UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 

Dead-Simple Deployment: Headache-Free Java Web Applications in the Cloud

  • 2. AbstractThe cloud has promised a lot to Java Web developers but has delivered on only some of the hype. Many issues still exist that have the ability to kill many a project. Elastic Beanstalk, a Web service announced by Amazon in early 2011, takes the cloud to the next level for Java Web applications. It aims to eliminate the remaining issues the cloud presents. No hardware purchases? Check! Low setup costs? Check! No software installation? Check! Automatic resource scaling? Check! Resource monitoring? Check! This presentation takes a deep dive into Amazon's Elastic Beanstalk service, including what problems it can help solve and opportunities it provides to deliver better Java Web applications.craigsdickson.com
  • 3. Speaker BioCraig S. Dickson is a software engineering professional with over 15 years of experience. He has proven leadership experience in both domestic and multi-national start-up and Fortune 500 corporations in the United States, Australia and Europe. Craig specializes in enterprise Java development and cloud architecture and holds multiple certifications including Sun Certified Architect for JavaEE and Certified ScrumMaster. Craig brings specific expertise in enterprise software architecture and design, refining development processes and building development teams around Agile software engineering principles. Educated in Australia, Craig holds a BSc(Hons) in Computer Science. He is based in Huntington Beach, CA, and Brisbane, Australia. craigsdickson.com
  • 4. Presentation OutlineWhat are the common problems related to developing and deploying a Java web app?How does Amazon Elastic Beanstalk (EB) attempt to address those problems?Do I have to change how I write my Java apps?What existing applications will work on EB?How much does EB cost?What are the alternatives to EB?craigsdickson.com
  • 5. The Downsides of being an Enterprise Java EngineerTopiccraigsdickson.com
  • 6. Early Stage DevelopmentGoal: isolated self-contained local development, quick code-test-code cyclesHow to demonstrate an individual’s work?How to demonstrate combined work?What about clients outside your firewall?How to push quick (automated) updates?craigsdickson.com
  • 7. What about Test and Stage? Goal: quick, consistent, production-like environment provisioningEnough resources to set up 2 more environments?Enough resources to make them production-like?What if your testers are not local?A clean environment for each round of tests?Will QA get angry if I run performance tests?craigsdickson.com
  • 8. What about Production?Goal: minimize cost, high availability, high reliability, monitoring, automated zero downtime upgradesHow do I migrate from staging to the production environment?What if it’s a success, how do I handle the traffic?What if it is a bomb, what do I do with all this hardware?It’s 2am, is my application up and running?The network card on one of my servers just died, how long will it take to replace?craigsdickson.com
  • 9. How does Elastic Beanstalk address these problems?Topiccraigsdickson.com
  • 10. What is Elastic Beanstalk?Platform-as-a-Service (PaaS) offering from Amazon Web Services (AWS)Built on top of existing AWS infrastructureLaunched January 2011, still officially BetaFirst (and currently only) supported application architecture is Java Web Applications on TomcatRuby rumored to be next language to be supportedcraigsdickson.com
  • 11. PaaS on top of IaaScraigsdickson.com
  • 14. Elastic Beanstalk Management ConsoleDemocraigsdickson.com
  • 15. Deploying Your First Elastic Beanstalk ApplicationDemocraigsdickson.com
  • 16. Currently Supported PlatformsApplication ServersTomcat 6Tomcat 7OSAmazon Linux 32 and 64bit versionsRHEL / CentOS basedbinary compatibility with RHEL 5Only interesting if you intend to use SSHcraigsdickson.com
  • 17. LoggingConfigured to use java.util.logging by defaultCan use a meta-framework like SLF4JStandard Tomcat logs are created (catalina.out etc)Can view snapshot of logs from management consoleCan be rotated out to S3 hourlyCan SSH to instances to view live logscraigsdickson.com
  • 18. Database IntegrationEB does not directly manage your databasesCan use the Amazon SimpleDBCan also use Amazon RDSCan also use an RDBMS running on an Amazon EC2 instanceCan also use a non-Amazon based databasePass JDBC connection info to app through consolecraigsdickson.com
  • 19. Monitoring and NotificationUses Amazon CloudWatch (CW) to monitor your environmentCan trigger scaling events based on metricscpu utilizationnetwork traffic, etc.EB adds a health check feature on top of CWMust have at least 1 URL that can be accessed without securityUses Amazon SNS to publish eventsscaling up / downhealth check failurescraigsdickson.com
  • 20. Auto-ScaleBased on CW events, your environment can be scaled up or down automaticallyCan configure what CW events trigger scalingCan set minimum and maximum instance countsCan control up / down instance incrementAlso can control how scaling events are generatedcraigsdickson.com
  • 21. Environment Hot SwapImagine you have an existing EB production environmentNow you have a new version ready to go live sitting in another EB environment (e.g. staging)EB supports URL Swappingstaging becomes production and production becomes stagingResults in zero application downtimecraigsdickson.com
  • 22. Managing Elastic Beanstalk EnvironmentsDemocraigsdickson.com
  • 23. How much do I have to change my development process?Topiccraigsdickson.com
  • 24. Developing for EBJava WAR files onlyStick to the standard JavaEE rulesdon’t read/write the local file system etcCode for a clustered environmentConnections to external resourcesconfigure via AWS management consolecraigsdickson.com
  • 25. Eclipse IntegrationEclipse plugin to integrate with EBCreate new Applications and Environments right from EclipseDeploy new Versions just by deploying to EB instead of a local TomcatFirst time deployment can take several minutesRapid code-test-code cycles should still be done locallyCareful about deleting the wrong environmentcraigsdickson.com
  • 26. First Elastic Beanstalk Application in EclipseDemocraigsdickson.com
  • 27. Locally Testing an Elastic Beanstalk Application in EclipseDemocraigsdickson.com
  • 28. Deploying To Elastic Beanstalk from EclipseDemocraigsdickson.com
  • 29. Command Line & Maven OptionsAll EB functions are available through a command line APIMaven plugin written by Aldrin Lealhttp://beanstalker.ingenieux.com.br/Wraps entire EB command line APIExcellent for faking EB support in other IDEs (Netbeans etc)Excellent for command-line builds, continuous integration (Jenkins) etccraigsdickson.com
  • 30. Which of my Existing Applications will work on Elastic Beanstalk?Topiccraigsdickson.com
  • 31. What applications work on EB?craigsdickson.com
  • 32. Custom Amazon Machine Image (AMI)Category D applications from the previous slide, need / want to access local resources and/or filesJenkins is an excellent example of this typeNeeds Maven, Ant and other tools to be availableNeeds to write build logs, archive artifacts etcStart with base EB AMI, then customizeSpecify your own AMI ID in the Environment Configurationcraigsdickson.com
  • 33. How much is it going to cost me?Topiccraigsdickson.com
  • 34. Cost SourcesEB itself is FREE!Pay as you go - for all other AWS servicesEC2 for running environmentsS3 for storing the versions of the applicationElastic Load Balancer instance and data chargesEBS to back the EC2 instance plus for any custom AMIs you createOutbound trafficcraigsdickson.com
  • 35. Example Price BreakdownAdapted from: http://aws.amazon.com/elasticbeanstalk/#pricingcraigsdickson.com
  • 36. Are there alternatives toElastic Beanstalk thatI should consider?Topiccraigsdickson.com
  • 37. VirtualizationCan’t I just get the same benefits with an in-house virtualization solution?Still need to setup the OS and Tomcat environment at least once.What about security and other updates?Can the in-house scale appropriately / automatically?craigsdickson.com
  • 38. Other PaaS VendorsIsn’t this just the same thing that other PaaS vendors already do?EB allows low level system accessSome PaaS vendors are running on AWS infrastructure anywayIf you need more than a Tomcat environment right now, then other vendors may be the way to goJavaEE server, Ruby, PHP etccraigsdickson.com
  • 39. SummaryAmazon Elastic Beanstalk is a PaaS solution built on top of the existing Amazon IaaS solutionsCurrently offers Tomcat 6 & 7 environmentsOften requires no modification to existing codeHas good tooling supportCan be extended through low-level system accessSolves many day-to-day problems for developerscraigsdickson.com
  • 40. Next StepsSign up for an EB account and deploy the sample applicationhttp://aws.amazon.com/elasticbeanstalk/Join the EB community forumhttps://forums.aws.amazon.com/forum.jspa?forumID=86Check EB related resources on my bloghttp://craigsdickson.com/tag/elastic-beanstalk/craigsdickson.com
  • 41. Questions?Craig S. DicksonEmail - [email protected] - http://craigsdickson.comLinkedIn – http://bit.ly/csd-liTwitter – http://bit.ly/csd-twcraigsdickson.com

Editor's Notes

  • #2: Good morning, thank you for making it here this morning after last nights activities I certainly appreciate the effort.My name is Craig Dickson and I am an independent enterprise java consultant and I am also an adjunct professor at the university of California in Irvine.
  • #5: In today’s presentation we will quickly look at some of the common problems that enterprise Java engineers face in their day to day lives when it comes to dealing with setting up environments for development time, testing time and production time scenarios.Then we will take a deep look at how Amazon Web Services’ new tool Elastic Beanstalk can help with the problems we identified.Next we will examine the impact using EB will have on your development process and how you write your Java applicationsWe will try to answer the question as to what it will cost you to get access to those fancy cloud features.And, finally we will take a quick look at some of the alternatives to Elastic Beanstalk in the Java Platform-as-a-Service space.
  • #6: Being an enterprise Java engineer is an excellent job. However there are many little annoyances that slow us down and make our jobs harder than they need to be on a day to day basis. Lets take a quick look at a few of these that are related to provisioning and managing runtime environments and deploying applications into those environments.
  • #7: Let’s talk about the activities that an enterprise Java developer has to complete during the early parts of the development process.The ultimate scenario is a self-contained development environment hosted entirely on your laptop which will allow you to write code, test the code and write more code in a tight loop. The tighter that loop the better. Possibly you are doing it more than one hundred times in a typical day. So any steps in that loop that make the loop take longer can really be devastating to your productivity. So any solution has to preserve your ability to do local development.But once you have written your code how do you demonstrate your code? If you want to demo it to your buddy in the next cube, you will probably just shout at him to come over and look at the coding miracle you have just performed.But what if you need to demonstrate your work to someone further away, like a client in another city or even another country. You could start by asking your sys admin to punch a hole in the firewall and just forward a port to your development machine. After they stop laughing at you, the next option might be to get them to setup a “demo” environment, which takes somewhere between 3 days and never to happen, because they are busy too and they may have slightly different goals. Next you have to give them your WAR file, which is of course too big to send by email, so then you have to get the right credentials so that you can FTP the file up to some box and then also send an email to the sys admin to let them know it is there. Then the sys admin will deploy it, just as soon as they get back from lunch. At this point hours or even days have passed by. If the deployment fails, you get to start the whole process all over again.What if another developer on your team needs to demonstrate some of their work to an external client at the same time? Maybe the two applications can be installed side by side in your demo environment, but more often than not they can’t, especially when you two are working on the same project. Rare is the engineer that hasn’t heard the cry from their sales team of “no one touch the demo environment for the rest of the day as Mega Client X is going to be onsite”.Of course, you work for a company that values quality software, so you have a continuous integration strategy in place, so your Jenkins server also needs a clean environment to push updates to and run your integration tests on. Just ask your friendly local sys admin to sent up a continuous integration environment for you and get ready to do a lot of explaining.
  • #8: Depending on what kind of development process you are following the Testing stage may start earlier or later in your project. But no matter when it starts, there are some common problems that often arise.So while you were in the early stage of development, your application server was running locally on your dev machine, you were probably using it just as it came configured and had it nicely integrated to your IDE.But when it comes to testing, you are going to need a whole separate environment, and hopefully one that is representative or identical to your production environment. Hopefully your sys admin has an environment ready for your QA team.What if you need to run some performance tests, can you run those at the same time that your QA team is working or do you need yet another environment? What if you are testing more than one version at a time? How do you make sure all of the QA environments are configured the same?Of course at some point once the application hopefully reaches a certain level of quality that you might want to make use of a staging environment, where you can do final customer demonstrations or maybe even some kind of beta release testing. How do you make sure the Staging environment is up and running quickly? How do you make sure it is also like production and like QA?
  • #9: And finally we reach production.Once you have functionally tested and performance tested and end user tested your application to death, not to mention private and public beta releases, how to you ensure that the production environment is identical to your testing and staging environments. Every little OS setting, every application server setting, every database setting, there is lot to keep track of.But lets say you do get your production environment up and running, what happens if you get slashdotted, or become the next Twitter trending topic, can your environment handle a massive and quick scale up? Do you have the hardware available? How quick can your sys admin get that hardware installed, get the operating system running, get the application server installed and configured, get the application deployed into that environment etc etc, the list is quite long. Your 15 minutes of fame might be over before any of that can happen.Of course the more common problem is that your shiny new product is dead on arrival. If you spent a lot of your budget on hardware, now all you have is a really expensive set of room heaters. And to make things worse, you don’t have any money left to hire the developers you need to fix the problems with your product.What if you are in the middle, with some mild success, enough to keep going at least. You probably whipped your team to within an inch of their life to get your product out there, so now they want to take a whole weekend off and get some sleep, play some World of Warcraft, work on their own Facebook killer app side project etc. Is that really possible, can your team walk away from your production environment for any length of time? How do you know if your application and your servers are running and performing as expected? Does someone need to monitor the log files and look for menacing looking stack traces, or maybe log in every couple of hours to see if the site is up? How long can that last?Finally, your accountant might consider your physical hardware as an asset, but when it breaks on a Saturday afternoon, it is going to feel a lot more like a liability to your iT team than an asset.
  • #10: OK, that’s a quick look at some of the problems related to deploying and managing Java environments that engineering teams face during the normal development, test and release lifecycle of a software product.Now lets look at how Amazon Web Service’s Elastic Beanstalk tool can help minimize or even eliminate these issues so you can concentrate more on developing your product as opposed to managing your environments in a professional way.
  • #11: Firstly, what is Elastic Beanstalk?Elastic Beanstalk is a Platform-as-a-Service solution for Java development from Amazon Web Services. For clarity, at a minimum, a Java Platform-as-a-Service solution provides a JVM based execution environment, built on top of production-ready cloud infrastructure, that allows for the easy deployment of applications, without having to provision or configure low level system resources.There are a few vendors in this space and I will mention them in a later slide.Not surprisingly, Amazon has built their PaaS solution on top of their existing proven infrastructure – services like EC2 and S3 are used to provide the PaaS functionality that Elastic Beanstalk delivers.Right now Elastic Beanstalk only supports Java Web applications that can be run in either a Tomcat 6 or Tomcat 7 environment.Amazon is an investor in Engine Yard which is a Platform-as-a-Service provider in the Ruby space among other things, and I had it confirmed by an Engine Yard employee at their booth at JavaOne this year that yes they are working with Amazon to bring Ruby to Elastic Beanstalk, but there are no dates, at least no public dates.
  • #12: Amazon Web Services pioneered the Infrastructure-as-a-Service market with their initial EC2 offering and the subsequent additional services that have been added over the last several years.The Platform-as-a-Service model is an abstraction layer over the Infrastructure-as-a-Service layer that hides many of the details of provisioning individual services. When working in the IaaS layer, developers must still talk in terms of servers and load balancers and redundancy and availability and things of that nature, even though it is all virtualized. When working in the PaaS layer, developers now simply talk about applications and environments to run those applications on.Elastic Beanstalk makes use of many of Amazon’s existing Infrastructure-as-a-Service products to deliver the kind of robust functionality necessary to create a reliable Platform-as-a-Service product.In addition to the services that Elastic Beanstalk uses directly to implement the PaaS functionality, developers are able to make use of other Amazon Web Service products such as SimpleDB and the Relational Database Service.
  • #13: The main component in Elastic Beanstalk is the Application.You can deploy multiple versions of your WAR file into a single Elastic Beanstalk Application. In this diagram there are currently four different versions of the same WAR file available.To run a Version of your application, you need to create an Environment. An Elastic Beanstalk environment consists of a set of configuration options that control how the resources within your application will be created, how they will work and how they will react to certain events, such as heavy load for example. In this example, there are four environments configured for this application. The Environment represents all of the Infrastructure-as-a-Service resources that your application will use. This is different to many of the other Paas vendors, where you do not get to see and manipulate the underlying resources directly. Much of the time the default settings are acceptable, however you always have the option to manually change the configuration options at any time.In this example, there are currently four versions of the application available. Version 1.0 is not deployed anywhere and presumably obsolete. Version 2.0 is running in the Environment labeled Production. Version 3.0 Beta is running in the Staging Environment as well as the Performance Test environment and Version 4.0 Alpha is running in the Environment labeled Test.All four environments may be configured identically, however that is not a requirement. You can have environments with very different configuration settings within the same Application. This is useful if you need to support more than one runtime configuration, or you would like to test out changes to your configuration before making those changes to your production environment.
  • #14: Each of the Environments on the previous slide, represent many resources that have been configured to work together to create a scalable and reliable runtime environment.The public face of an Elastic Beanstalk environment is an Elastic Load Balancer instance. This is where all of the public traffic comes through to get to your application. The load balancer does common load balancing tasks like spreading requests across the available EC2 instances to spread the workload. However it is also responsible for monitoring the health of each EC2 instance and can terminate an instance if it fails – we will look at how that works later.Behind the load balancer are the actual EC2 instances that have the Tomcat environments on them. The EC2 instances belong to what is called an Auto Scaling Group. Currently there are 3 instances in the Auto Scaling Group, and that number will increase or decrease based on certain conditions that the Elastic Beanstalk system watches for. If there is a high load on all 3 servers, Elastic Beanstalk can spin up more servers, up to a maximum of 10,000 currently. If the servers are under light load, Elastic Beanstallk can also start shutting down instances automatically. As an administrator you do have some control over those scaling up and scaling down events, and that is part of the Environment configuration settings.Technically speaking the Elastic Load Balancer and the Auto Scaling Group are the end of the Elastic Beanstalk story. However, it is quite common for a Java Web Application to need to connect to some kind of datastore, traditionally a relational database. It is very easy from your Java War file to use Amazon’s SimpleDB service, which is Amazon’s NoSQL like service, or you can use the Relational Database Service where you can connect to MySQL or even Oracle databases. However, your application does not have to use a database at all, and if it does, it does not have to use any of Amazon’s database services.
  • #15: So now that you have a rough idea of the main parts that make up Elastic Beanstalk, lets take a look at the web based management console that Amazon provides for managing your Elastic Beanstalk resources.
  • #16: Now lets deploy our first Java Web Application into our Elastic Beanstalk environment.
  • #17: As we have seen in the demonstrations, Elastic Beanstalk currently supports both Tomcat 6 and Tomcat 7.In some PaaS environments like Google App Engine you have no interest in what is running under the covers because the vendor goes to great length to hide it from you. And there are some very good reasons for doing it that way. On the other hand Elastic Beanstalk does give you the option to look under the covers if you want to. The default configuration is going to be sufficient for a large majority of applications, however if you need to tweak the low level resources you can.So if you do dig in you will find that Elastic Beanstalk is made up of EC2 instances and they are all running what is called Amazon Linux and you have both 32 and 64bit options there. If you are wondering what Amazon Linux is, it is basically a custom linuxdistro based on a combination of Red Hat Enterprise Linux and CentOS, with some settings and configuration that make the os play nicely in Amazon’s EC2 world. So if you are familiar with any of the RedHat based linux flavors, you will right at home.
  • #18: Logging seems like a benign thing, but when you want to debug an issue and you don’t have access to log files, things get pretty tough pretty quickly. If you follow the EB community forums you will see that questions about logging are some of the most common.So the Elastic Beanstalk environment supports logging in a variety of ways.By default, the Tomcat environment is configured to use the JDK Logging API. Obviously coding directly to that API is a probably a bad idea, so using something like SLF4J to keep your code a little more portable is recommended.The Tomcat installations do create the standard log files like catalina.out, but unless you want to SSH to each of the EC2 instances all the time to see them, that can be a bit of a pain.From the management console as we saw in the demonstration you can request to have snapshots taken and you can easily view those from a browser.Alternatively you can have those snapshots posted to an S3 bucket where you could be downloading them automatically and running some kind of parser on them for example.Keep in mind though that the snapshots that EB creates, whether manually from the console or automatically for the S3 dumps, they only include the standard Tomcat logs. So if your application is creating its own log files, then you will need to either change to log to the standard Tomcat logs, or you will have to come up with your own system for rotating them out to S3 or some other location.
  • #19: EB does not manage databases.So you can connect to any database you like, including those that are part of other AWS products like SimpleDB and RDS – there are some nice sinergies between Elastic Beanstalk and the RDS service in terms of reliability and failover that can add a lot of robustness to your application with very little work. Or you can connect to your own database running on another vanilla EC2 instance, or even a database running outside of the Amazon environment altogether. EB does not restrict your database options in any way.Whatever database you choose, you can inject the connection settings into your application using the Container Parameters section of the Environment Configuration Dialog.
  • #20: Elastic Beanstalk uses the existing CloudWatch service from Amazon for monitoring your EB environments.You can configure with a high degree of precision which CloudWatch events trigger scaling up or scaling down to happen in your environment.In addition to the CloudWatch scaling checks, Elastic Beanstalk also supports a health check feature. The Elastic Load Balancer monitors each EC2 instance by hitting a specified URL and waiting for a response. If the request times out or the response does not indicate success, like a 404 for example, then the Elastic Beanstalk system will shutdown that EC2 instance and replace it with a new healthy one.This health check URL feature does mean that you have to have at least 1 URL in your application that the Load Balancer can request. This is a common issue that comes up in the community forums as well, where people have a non-existent URL configured, or they have a URL configured that requires authentication. What ends up happening is that EB starts up the EC2 instance, is never able to get a successful health check performed, and so the EC2 instance is shutdown. To the user it looks like their application failed to start up at all as the status icon for the environment never turns green.
  • #21: Auto Scaling is another service that EB makes use of from the underlying Amazon infrastructure services.Through the Environment configuration dialog you can control which CloudWatch events trigger the auto scaling functionality.You can also control the minimum number of instances to avoid a lot of thrashing of your environment, and you can also set the maximum number of instances to help control costs.Each up or down scaling event can add or remove multiple EC2 instances at a time, and this is also configurable by the user.And finally for Auto-Scale you can also control the time between scaling events to avoid having too many instances added for short bursts of heavy traffic for example.
  • #22: So imagine you have an existing Elastic Beanstalk environment up and running as your customer facing production environment.But now you have a new version of the application and it has been through QA, performance testing and a round of beta testing and is finally ready to go live. Traditionally you might have taken your production system down, put up a maintenance page, deployed the new version of your application to the production environment, started up everything again and hoped everything worked. Because in reality, you have never tested your new version in this environment. There are many things that could go wrong. There could be subtle differences between your staging and your production environment or somebody could grab the wrong version of the code to deploy and the list goes on.So if you have a stable tested staging environment, why not just make that your new production environment. EB supports this idea with what it calls URL Swapping.Because you are working at the PaaS layer and are not dealing with low level resources, it is reasonably easy through a simple DNS change to make the production URL point at your staging environment and vice versa. Elastic Beanstalk does all of the work for you and it results in no downtime of your production URL.
  • #23: Lets take a look at all of the options we have for managing and controlling our Elastic Beanstalk environments.
  • #24: OK, so we have seen that Elastic Beanstalk brings a lot of benefits to the development process, particularly in the area of provisioning and managing runtime environments. But if you have to change your whole development process or your application architecture, are those benefits really worth that much?Lets take a look at how working with Elastic Beanstalk might change the way you go about writing your applications.
  • #25: First of all, because Elastic Beanstalk only supplies Tomcat environments currently, that means you are restricted to just applications that are packaged as Java WAR files. So if you are one of these developers that loves EJBs, then Elastic Beanstalk is not currently for you.If your application does a lot of things that the Servlet specification says you shouldn’t, then Elastic Beanstalk also might not be for you. For example if you write a lot of files to the file system as a permanent storage mechanism, then the default Elastic Beanstalk setup will not work for you, as you have no control over when a server will be terminated or started, so you will lose your file system based data.While Elastic Beanstalk is not technically a clustered environment as many of the current Java application servers would define it, it is still a good idea to code as if it were a clustered environment. For example, don’t assume the application context is global across your entire environment.So generally speaking, if you have written your war file in a standards compliant way and have been careful not to make too many assumptions about your runtime environment, then your application should be able to be deployed onto an Elastic Beanstalk environment with no code changes being required.The one area that might actually require some minor code changes is how EB provides environment specific settings, for example the JDBC connection string to be used by your application. This can be easily abstracted away, particularly if you are already using a tool like Spring, so that you don’t accidentally end up locked in to one vendor.
  • #26: So we have seen how to manage Elastic Beanstalk resources through the web based management console, but that is probably a little slow and cumbersome for real developers. The good news is there are some other options available. The biggest of which is the Eclipse plugin that Amazon provides that not only allows you to manage your Elastic Beanstalk applications, but also some of the other Amazon services as well.From within Eclipse you can create brand new applications and also push new versions of existing applications. However, there is some overhead in pushing new versions out to the EB environment, so you should still plan on doing most of your work locally, which is very practical and doable since Elastic Beanstalk does not require any special code or environment setup to run so all of your normal tools will still work.One thing from the community forums that has come up is that the Eclipse interface does make it easy to accidentally delete your EB environment, when you had intended to delete a local Tomcat instance instead, so keep an eye out for that.
  • #27: Lets take a look a first look at getting setup and and creating our first EB application in Eclipse.
  • #28: OK, so now we have created an Elastic Beanstalk application, lets make sure we can test it locally just like we always have with our other applications.
  • #29: Ok, so we created the application and have tested it locally, lets now push that application out to our Elastic Beanstalk environment.
  • #30: If you are not an Eclipse person, and I am not, then you might be looking for other options.Amazon provides an extensive command line interface to elastic beanstalk and like with many of their other command line interfaces for their other products you can often do more with the command line than you can with the web management console.In addition there is a pretty good Maven plugin available now that was written by one of the community members and seems to be getting positive feedback in the forums. Once you have integration with a tool like Maven of course, you can now include Elastic Beanstalk into your whole development process, especially good for things like Continuous Integration – it is very easy to start stop and reset environments and upload and deploy new code versions for running unit tests.
  • #31: So unless you are a lucky engineer and only work on brand new projects, you probably have some existing projects that you will need to maintain for a while longer and you would like to get them onto Elastic Beanstalk. Lets take a look at some of the issues you might face.
  • #32: From a migration to Elastic Beanstalk point of view, there are really 4 categories of applications and depending on which category your application falls into you may have more or less trouble making the migration happen.Category A is the easiest – a war file that does not need access to any external resources like a database or the files system. Category A applications can be deployed as is.Category B are the next easiest as long as the connection information to the other AWS services, like your AWS credentials can be passed in through the EB console, then these applications may only require slight code changes if any at all.Category C applications are similar to Category B, in that they access external services, but in this case the services are hosted outside of the Amazon environment. Like Category B, as long as the information needed by your application to connect to these services can be passed in through the elastic beanstalk console, then your application may only require slight code changes if any at all.Category D are the hardest applications to migrate to elastic beanstalk. These applications are often implemented in a way that potentially violates the servlet specification and do things like read and write to the local file system for persistent storage. Alternatively, they may just rely on certain binaries or resources being available on the host machine that are not available as part of the standard elastic beanstalk server image. So it is fair to say that out-of-the-box, elastic beanstalk does not support Category D applications, however if you are prepared to get your hands a little dirty, there is an officially supported way to solve this problem.
  • #33: In Amazon EC2 speak, an Amazon Machine Image is the basis for a virtual machine – think of it as a snapshot of a virtual machine.Amazon publishes 4 different AMIs related to elastic beanstalk – combination of 32 and 64 bit linux, plus Tomcat 6 and Tomcat 7. So depending on what container you pick when configuring your environment, you will be selecting one of these AMIs to base all of the EC2 instances in your environment on.However, Amazon also supports you providing your own custom AMI for elastic beanstalk to use. There is a trick to this and you cannot just use any old AMI. There are specific things that elastic beanstalk needs to be installed and configured on your EC2 instances that allow it to monitor the instance for health and doing scaling activities. So if you use one of your existing AMIs you will not have these elastic beanstalk specific pieces on your machine and your AMI will not work with elastic beanstalk.Instead what you do is take a snapshot of one of the official 4 AMIs that Amazon has published and use it as a starting point. From there you can add any additional software you need to it for example.Then when you are configuring your environment, you can pass in the unique ID of your custom AMI, instead of using one of the officially published AMIs.
  • #34: So how much is all of this cloud coolness going to cost.
  • #35: The good news is that Elastic Beanstalk itself is completely free.However, you do pay for the underlying infrastrucutre services that elastic beanstalk makes use of.So you will have EC2 charges for all of the EC2 instances you spin up and shutdown.You will have S3 storage charges for each version of the application you have uploaded.The elastic load balancer that sits in front of your EC2 instances also has charges associated.There will also be Elastic Block Storage charges for backing your live EC2 instances as well as any custom AMIs you create to use with elastic beanstalkAnd finally of course, there are charges for the outbound traffic from your application to the internet.
  • #36: This table is available on the elastic beanstalk website.As you can see there are actually a lot of places where you can incur charges, however most of these charges are very small and some will barely increase at all even if you have a hugely successful website – for example the storage charges for your war file in S3 won’t increase just because your application is successful.If you compared these charges to buying a lot of physical hardware or even licenses for tools like VMWare to run your own virtualization infrastructure, from what I have experienced the pricing is very competitive.
  • #37: There are many ways to achieve some or all of the functionality provided by elastic beanstalk with tools from other vendors, lets take a quick look.
  • #38: Obviously some of the benefits that elastic beanstalk provides can also be achieved through plain virtualization tools – like being able to replicate environment settings easily.But remember you are still going to need to provision and manage the operating systems and application servers on those virtual machines. Also can you automatically scale your environment to meet increased demand or scale it back when demand is low – at some point you have to have some physical hardware to run your virtual machines on and as a result you have a finite amount of resources which may turn out to not be enough if your application takes off.
  • #39: There are certainly other Platform-as-a-Service vendors for Java environments.CloudBees, Heroku, OpenShift from RedHat, Google AppEngine are all examples of Platform-as-a-Service solutions, and there are many more.Each vendor has their own quirks about how to go about things, or what a Platform-as-a-Service solution does or doesn’t provide.Many of these other vendors actually run on top of Amazon’s infrastructure anyway, so keep that in mind when looking at alternatives.Elastic Beanstalk does provide that low level system access if you need it, which most other vendors do not provide, so if that is a must have for you, then elastic beanstalk is probably the way to go.However, elastic beanstalk currently only supports the Java web app on Tomcat architecture, so if you are looking for a solution that supports other technologies like a full JavaEE stack or Ruby, then some of the other vendors might be a better selection, at least for now.
  • #40: So just a quick recap.Elastic Beanstalk falls in to the Platform-as-a-Service category and is built on top of the infrastructure services that Amazon already provides.For the moment you get a choice of either Tomcat 6 or Tomcat 7 and you also get a 32bit or 64bit operating system choice if that is important to you.Because it is simply a managed Tomcat environment, most well written web applications can be moved over to elastic beanstalk with little to no code modifications or restrictions, which is an important differentiator when looking at some of the other solutions in this space.There is already good tooling out there including the eclipse plugin, the maven plugin and the command line API provided by AmazonIf you really need to you can get your hands dirty and access your EC2 instances via SSH and you can modify the actual EC2 instances being used by elastic beanstalk if you need to add additional features. Keep in mind though, this really is a last resort, your life will be a lot simpler if you can work with the out-of-the-box features that elastic beanstalk provides.And last but not least, hopefully I have shown that elastic beanstalk can solve many of the common problems that developers have with managing various runtime environments during the development process.