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.
Best Practices For Hosting Web Applications on AWS            Jeff Barr   Senior Web Services Evangelist            @jeffb...
Today’s Agenda            Availability            Static content            Multi-tier applications            Summary
Spectrum of Websites
Spectrum of WebsitesStatic                 Dynamic
Spectrum of WebsitesStatic                 DynamicSimple                 Complex
Spectrum of WebsitesStatic                   DynamicSimple                   ComplexNiche                  Mass Market
Get Your Priorities Straight  Availability is important   Support your customers   Support your business                ...
Everything fails  all the time   Werner Vogels, Amazon CTO
Infrastructure Services Can Save The Day
Your Data is a Royal Garden
Your Infrastructructure is a Fungible Resource
Patterns for High Availability
Pattern 1Static Content
ImagesStylesheets                          Streaming                          contentWeb pages      Web              Asset...
High                      HighRedundancy                 Availability             Amazon S3                High           ...
S3 Object Access URLs http://s3.amazonaws.com/bucketname/objectid http://bucketname.s3.amazonaws.com/objectid https://s3.a...
S3 Uses Perfect for asset hosting Perfect for website hosting             Let’s see how…
aws.amazon.com/console
Make everything public
https://s3.amazonaws.com/jbarr/site/index.html
However…. Brittle, unfriendly URL S3 website hosting Root objects Error pages
http://jbarr.s3-website-us-east-1.amazonaws.com/
Content Distribution – Amazon CloudFront Speed of light causes increased latency with distance….
Amazon CloudFront Global edge caching (18 locations) Friendly URLs – default root object Distribution-based               ...
d3e7617hqtdwhu.cloudfront.net
http://d3e7617hqtdwhu.cloudfront.net/site/jeffbarr.jpg
What Did We Do? Upload website to S3 Create CloudFront Distribution Make site (file and image) accessible with low latency...
Update DNS Entry                   www.jeff-barr.com
What We Have Built     www.jeff-barr.com         Global          DNS CNAME         Global          Amazon CloudFront      ...
Pattern 2Dynamic or Multi-Tier Content
Ruby on Rails       PHP                               DjangoPerl             Dynamic                           Spring  Dat...
Blogs  E-commerce                                 Gaming       Dynamic                                 AppsProductivity   ...
Elastic                 MultipleCapacity                Instance                          Sizes           Amazon EC2      ...
Mastering                        Multiple failure                        availability                                  zon...
High Availability With EC2 Single Server Fail Over
High Availability With EC2                 Elastic IP Address                   EC2 Instance                   EBS Storage...
Instance Failure                   Elastic IP Address                     EC2 Instance                     EBS Storage    ...
Instance Failure – Replace Instance                      Elastic IP Address       EC2 Instance                        EC2 ...
Instance Failure –Back to Normal                Elastic IP Address                  EC2 Instance                  EBS Stor...
Attributes Inexpensive but not ideal Requires monitoring and automation Allows for ‘hot swap’
High Availability With EC2 Horizontal Redundancyfor Multi-Tier Applications
Multiple Tiers                    Web Servers                 Application Servers                     Data Store
Multiple Tiers with Redundancy at Each Tier                    Web Servers                   Web Servers                  ...
This Architecture Tolerates Instance Failure                     Web Servers                    Web Servers               ...
Tolerant to Availability Zone Failure                       Elastic Load Balancer         Web Servers                     ...
Scale In and Scale Out as Needed                    Web Servers                   Web Servers                  Web Servers...
Spinning Up a Multi-Tier      Application
Create MySQL server withAmazon RDS
Launch 4 EC2Micro Instances
Create an Elastic Load Balancer
Add my instances   to the load    balancer
Database Scaling    Scale Up CPU                    Add Storage                   Add Redundancy
Database Scaling – Add Read Replicas
Recovering From FailuresAuto-Healing and Auto-Scaling
Elastic Load BalancingCloudWatch                  Auto Scaling
Create Launch Configurationas-create-launch-config  MyConfig  --image-id ami-123456  --instance-type m1.small  --key jbarr...
Create Auto Scaling Groupas-create-auto-scaling-group   MyScalingGroup   --launch-configuration MyConfig   --availability-...
Set Scaling Rulesas-create-or-update-trigger                CPUUtilization                 DiskReadBytes                  ...
SummaryWhat We Have Seen and      Learned
What We Have Learned  Importance of high availability  Hosting assets on S3  Content distribution with  CloudFront  Web ap...
Q&A
Thank You!
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Best Practices for Hosting Web Applications on AWS
Upcoming SlideShare
Loading in …5
×
Upcoming SlideShare
Introduction to Amazon Web Services
Next

15

Share

Best Practices for Hosting Web Applications on AWS

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Best Practices for Hosting Web Applications on AWS

  1. 1. Best Practices For Hosting Web Applications on AWS Jeff Barr Senior Web Services Evangelist @jeffbarr Matt Tavis Solutions Architect
  2. 2. Today’s Agenda Availability Static content Multi-tier applications Summary
  3. 3. Spectrum of Websites
  4. 4. Spectrum of WebsitesStatic Dynamic
  5. 5. Spectrum of WebsitesStatic DynamicSimple Complex
  6. 6. Spectrum of WebsitesStatic DynamicSimple ComplexNiche Mass Market
  7. 7. Get Your Priorities Straight Availability is important  Support your customers  Support your business However…
  8. 8. Everything fails all the time Werner Vogels, Amazon CTO
  9. 9. Infrastructure Services Can Save The Day
  10. 10. Your Data is a Royal Garden
  11. 11. Your Infrastructructure is a Fungible Resource
  12. 12. Patterns for High Availability
  13. 13. Pattern 1Static Content
  14. 14. ImagesStylesheets Streaming contentWeb pages Web Assets Blog posts PDFs Javascript Videos
  15. 15. High HighRedundancy Availability Amazon S3 High durability
  16. 16. S3 Object Access URLs http://s3.amazonaws.com/bucketname/objectid http://bucketname.s3.amazonaws.com/objectid https://s3.amazonaws.com/bucketname/objectid https://bucketname.s3.amazonaws.com/objectid
  17. 17. S3 Uses Perfect for asset hosting Perfect for website hosting Let’s see how…
  18. 18. aws.amazon.com/console
  19. 19. Make everything public
  20. 20. https://s3.amazonaws.com/jbarr/site/index.html
  21. 21. However…. Brittle, unfriendly URL S3 website hosting Root objects Error pages
  22. 22. http://jbarr.s3-website-us-east-1.amazonaws.com/
  23. 23. Content Distribution – Amazon CloudFront Speed of light causes increased latency with distance….
  24. 24. Amazon CloudFront Global edge caching (18 locations) Friendly URLs – default root object Distribution-based Let’s see how…
  25. 25. d3e7617hqtdwhu.cloudfront.net
  26. 26. http://d3e7617hqtdwhu.cloudfront.net/site/jeffbarr.jpg
  27. 27. What Did We Do? Upload website to S3 Create CloudFront Distribution Make site (file and image) accessible with low latency Current CloudFront edge locations: • Ashburn, VA • St. Louis, MO • Dallas/Fort Worth, TX • Amsterdam • Jacksonville, FL • Dublin • Los Angeles, CA • Frankfurt • Miami, FL • London • New York, NY • Paris • Newark, NJ • Hong Kong • Palo Alto, CA • Tokyo • Seattle, WA • Singapore
  28. 28. Update DNS Entry www.jeff-barr.com
  29. 29. What We Have Built www.jeff-barr.com Global DNS CNAME Global Amazon CloudFront Regional Amazon S3 Redundant storage
  30. 30. Pattern 2Dynamic or Multi-Tier Content
  31. 31. Ruby on Rails PHP DjangoPerl Dynamic Spring Database Data store
  32. 32. Blogs E-commerce Gaming Dynamic AppsProductivity Social networks
  33. 33. Elastic MultipleCapacity Instance Sizes Amazon EC2 On-demand
  34. 34. Mastering Multiple failure availability zones High Availability Automation and monitoring
  35. 35. High Availability With EC2 Single Server Fail Over
  36. 36. High Availability With EC2 Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
  37. 37. Instance Failure Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
  38. 38. Instance Failure – Replace Instance Elastic IP Address EC2 Instance EC2 Instance EBS Storage EBS Snapshot
  39. 39. Instance Failure –Back to Normal Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
  40. 40. Attributes Inexpensive but not ideal Requires monitoring and automation Allows for ‘hot swap’
  41. 41. High Availability With EC2 Horizontal Redundancyfor Multi-Tier Applications
  42. 42. Multiple Tiers Web Servers Application Servers Data Store
  43. 43. Multiple Tiers with Redundancy at Each Tier Web Servers Web Servers Web Servers Application Servers Application Servers Application Servers Data Store Data Store Data Store
  44. 44. This Architecture Tolerates Instance Failure Web Servers Web Servers Web Servers Application Servers Application Servers Application Servers Data Store Data Store Data Store
  45. 45. Tolerant to Availability Zone Failure Elastic Load Balancer Web Servers Web Servers Web Servers Web Servers Web Servers Web Servers Application Servers Application Servers Application Servers Application Servers Application Servers Application Servers Data Store Data Store Data Store Data Store Data Store Data Store US-East-1A US-East-1B US-East
  46. 46. Scale In and Scale Out as Needed Web Servers Web Servers Web Servers ApplicationServers Servers ApplicationServers ApplicationServers ApplicationServers Application Application Servers Data Store Data Store
  47. 47. Spinning Up a Multi-Tier Application
  48. 48. Create MySQL server withAmazon RDS
  49. 49. Launch 4 EC2Micro Instances
  50. 50. Create an Elastic Load Balancer
  51. 51. Add my instances to the load balancer
  52. 52. Database Scaling Scale Up CPU Add Storage Add Redundancy
  53. 53. Database Scaling – Add Read Replicas
  54. 54. Recovering From FailuresAuto-Healing and Auto-Scaling
  55. 55. Elastic Load BalancingCloudWatch Auto Scaling
  56. 56. Create Launch Configurationas-create-launch-config MyConfig --image-id ami-123456 --instance-type m1.small --key jbarr-key --group “Web and SSH”
  57. 57. Create Auto Scaling Groupas-create-auto-scaling-group MyScalingGroup --launch-configuration MyConfig --availability-zones us-east-1a,us-east-1b --min-size 5 --max-size 10 --load-balancers demo-load-balancer Keep at least 5 and as many as 10 instances running!
  58. 58. Set Scaling Rulesas-create-or-update-trigger CPUUtilization DiskReadBytes DiskReadOps DiskWriteBytes DiskWriteOps NetworkIn NetworkOut FreeStorageSpace ReadLatency …
  59. 59. SummaryWhat We Have Seen and Learned
  60. 60. What We Have Learned Importance of high availability Hosting assets on S3 Content distribution with CloudFront Web applications and EC2 Multi-tier application hosting Database management with RDS
  61. 61. Q&A
  62. 62. Thank You!
  • arjun_s

    Jan. 8, 2018
  • amolbehrani

    Mar. 1, 2017
  • JwelMolla1

    Feb. 16, 2017
  • sunduowei

    Feb. 12, 2017
  • anirudhac

    Dec. 20, 2015
  • ravindrasingh143

    Jul. 1, 2015
  • JorgeRoberto5

    Jun. 17, 2015
  • coreywei

    Apr. 15, 2015
  • comber77

    Mar. 1, 2015
  • kumarthanga33

    Jun. 19, 2014
  • RamitBhardwaj

    Sep. 20, 2012
  • arokiaindia

    Aug. 23, 2011
  • absolutcarrie

    Aug. 5, 2011
  • brimbrom

    May. 20, 2011
  • grell

    May. 19, 2011

Views

Total views

9,555

On Slideshare

0

From embeds

0

Number of embeds

6

Actions

Downloads

0

Shares

0

Comments

0

Likes

15

×