Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Scaling Your Web Applications with AWS Elastic Beanstalk

2,389 views

Published on

by Randall Hunt, Evangelist, AWS

  • Hey guys! Who wants to chat with me? More photos with me here 👉 http://www.bit.ly/katekoxx
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Scaling Your Web Applications with AWS Elastic Beanstalk

  1. 1. Scaling Your Web Applications with AWS Elastic Beanstalk Randall Hunt Feb 2017
  2. 2. Who am I? • NASA, Amazon, SpaceX, Amazon • Just a regular software engineer • Email me: randhunt@amazon.com … but seriously someone should email me. I’m bored. • Follow me on twitter to see lambda in action: @jrhunt • Thanks: • Jeff Hoffman, Adhiraj Singh, Prahlad Rao for slides!
  3. 3. Agenda • Elastic Beanstalk • Demo • Best Practices • Q/A
  4. 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 scaling infrastructure? • Lack of consistency across teams.
  5. 5. Why Elastic Beanstalk? AWS Elastic Beanstalk is an easy-to-use service for deploying, scaling, and managing web applications and services.
  6. 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)
  7. 7. Benefits • Fast & simple • to begin Developer productivity/agility • Impossible to outgrow • Complete resource control No additional charge to use Elastic Beanstalk. You pay only for underlying AWS resources (i.e., EC2 instances, S3, etc.)
  8. 8. Common Use Cases •Websites •Mobile backends •API Backends •Asynchronous workers
  9. 9. Ok how do I start?
  10. 10. Supported Platforms • Node • Java (tomcat, etc.) • PHP • Docker • Dot Net • Python (flask, django, etc.) • Ruby (rails, etc.) • Go
  11. 11. Deploying Your Applciation 01 02 03 04 Region Stack (container) type Single Instance Load Balanced with Auto ScalingOR Database (RDS) Your code Optional
  12. 12. Building Blocks Application Application Versions ( V1, V2, …,Vx) Environment 1 Environment 2 Environment .. n
  13. 13. Actually Deploying • Use the AWS Console • The Eclipse or Visual Studio IDE • AWS SDKs and CLI • Awsebcli (my preferred method)
  14. 14. DEMO
  15. 15. Best Practices
  16. 16. Deployment Options Environment Type Deployment category Method All at Once* Immutable (New) Disabled*^ Immutable (New) All at Once Rolling* Rolling with additional batch Immutable Disabled^ Rolling based on Health* Rolling based on Time Immutable Single Instance Load Balanced/Auto-Scaled Application Platform/Configuration Application Platform/Configuration
  17. 17. Application deployment options Method Impact of failed deployment Deploy Time Zero Downtime No DNS Change Rollback process Code Deployed To All at Once Downtime  X  Re-deploy Existing instances Rolling Single batch out of service. Any successful batches prior to failure running new application version ♦   Re-deploy Existing instances Rolling with additional batch Minimum if first batch fails, otherwise similar to Rolling ♦   Re-deploy New & existing instances Immutable Minimal    Re-deploy New instances Blue/Green Minimal   X Swap URL New instances  Options available for both Single Instance and Load Balanced/Auto-Scaled Environments ♦ Varies depending on instance batch size
  18. 18. Managed Platform Update • Configure your environment to automatically upgrade to the latest version of a platform during a scheduled maintenance window. • Permissions • Maintenance Window • Minor and Patch Updates Key benefits: • Automated Upgrades • No/Minimal downtime • No/Minimal impact on capacity • Flexibility of manual updates • Instance replacement
  19. 19. Best Practices • Deployment Options • Managed Platform Updates • Auto Scaling • Other Tips
  20. 20. Auto Scaling Min/Max instances Availability Zones Scaling cooldown Triggers based scaling Trigger measurement (CPU utilization, network traffic, disk activity, instance health) Trigger statistic Measurement period Breach duration Thresholds Breach scale increment Time-based scaling Name Min/Max instance Occurrence (One-time, Recurrent) Recurrence (CRON expression- 30 8 * * 3)
  21. 21. Other tips • Logs, Metrics, & Alarms • Enable log rotation to automatically publish logs to S3. • Understand metrics available for your environment and what they mean. • Set up alarms to automatically monitor critical metrics and send notifications when metrics are outside normal operating range. • Enable Amazon Route 53 health checks and alarms • Tag your environments • Makes it easy to find resources belonging to a given environment. • Can be used to monitor costs associated with a given environment and/or application. • AWS Elastic Beanstalk automatically tags environments with: • Environment Name • Environment ID
  22. 22. Other tips • Logs, Metrics, & Alarms • Enable log rotation to automatically publish logs to S3. • Understand metrics available for your environment and what they mean. • Set up alarms to automatically monitor critical metrics and send notifications when metrics are outside normal operating range. • Enable Amazon Route 53 health checks and alarms • Tag your environments • Makes it easy to find resources belonging to a given environment. • Can be used to monitor costs associated with a given environment and/or application. • AWS Elastic Beanstalk automatically tags environments with: • Environment Name • Environment ID

×