Your SlideShare is downloading. ×
High Availability   Websites                              Matt Wood        T E C H N O L O G Y   E VA N G E L I S T
AGENDA High Performance Websites: Part 11. Availability2. Static content3. Multi-tier applications4 . Per formance boost5....
Spectrum of websites
Static           DynamicSpectrum of websites
Static            DynamicSimple           Complex Spectrum of websites
Static            DynamicSimple            ComplexNiche            Mass market Spectrum of websites
Availability is important
Support your customers
Support your  business
However...
“Everything fails  all the time                           ”    Werner Vogels, Amazon CTO
Infrastructure services cansave the day
Focus on your stuff
Patterns foravailability
1. Static content
ImagesStylesheets                              Streaming                               content              Assets Video  ...
Templates                     ImagesStylesheets                                    Streaming                              ...
High                      Highredundancy                availability    Amazon S3               High             durability
http://s3.amazonaws.com/bucketname/objectid http://bucketname.s3.amazonaws.com/objectid
https://s3.amazonaws.com/bucketname/objectidhttps://bucketname.s3.amazonaws.com/objectid
Perfect for asset    hosting
Perfect for website      hosting
Let’s see how...
aws.amazon.com/console
Make everything public
index.html               Texthttp://mza.s3.amazon.com/site/index.html
https://mza.s3.amazon.com/site/index.html
https://mza.s3.amazon.com/site/index.html
:(
Unfriendly, brittle URL:http://mza.s3.amazonaws.com/s3/index.html
S3 websites
Root objects
Error pages
Let’s see how...
https://my-website.s3-website-eu-west-1.amazon.com
https://my-website.s3-website-eu-west-1.amazon.com
Contentdistribution
Increased latency
CloudFrontPowerful content delivery network
Global edge caching         +   Friendly URLs
Let’s see how!
d19r58gd5nvk1.cloudfront.net
d19r58gd5nvk1.cloudfront.net/site/index.html
UpdateDNS CNAME
friendly-example.com/index.html
Set CloudFrontDefault Root Object
API or S3 client
CloudBerry Explorer      API or S3 client                      Cyberduck
amazon_s3.html
friendly-example.com
friendly-example.com        Global         DNS CNAME        Global         Amazon CloudFront       Regional        Amazon ...
2. Dynamic ormulti-tier content
Ruby on Rails  PHP                          DjangoPerl        Dynamic                              SpringDatabase         ...
BlogsE-commerce              Gaming        DynamicProductivity                        Apps      Social networks
Elastic                  Multiplecapacity               instance sizes     Amazon EC2           On-demand
Mastering                        Multiple failure                     availability zones  High availability            Aut...
H I G H AVA I L A B I L I T Y W I T H E C 2Single server  fail over
Elastic IPEC2 instance
Elastic IPEC2 instanceEBS storageEBS snapshot
Elastic IPEC2 instanceEBS storageEBS snapshot
Elastic IPEC2 instanceEBS storageEBS snapshot
Elastic IPEC2 instanceEBS storageEBS snapshot
Cheap, but not ideal
Requires monitoring  and automation‘Hot swap’ possible
H I G H AVA I L A B I L I T Y W I T H E C 2   Horizontal  redundancy
Applications with  multiple tiers
Web serversApplication serversData store
Redundancy at  each tier
Web serversApplication serversData store
Tolerant toinstance failure
Web serversApplication serversData store
Tolerant toAZ failure
eu-west-1   eu-west-2                        Web servers                        Application servers                       ...
Scale in and out    (if you need to)
Web serversApplication serversData store
Load balance
Elastic Load BalancerWeb serversApplication serversData store
Let’s take a look!
Spin up your stack        +Prepare for battle!
MySQL server with  Amazon RDS
Endpoint
Configure app +  cut an AMI
Create Image
Spin uphorizontal  layer
4
http://ec2-46-137-20-114.eu-west-1.compute.amazonaws.com
http://ec2-46-137-20-114.eu-west-1.compute.amazonaws.com
Load balance
Elastic Load BalancerWeb serversAmazon RDS
Elastic Load BalancerWeb serversAmazon RDS
Multiple AZdeployment
Elastic Load Balancereu-west-1a   eu-west-1b                          Web servers                          Amazon RDS
eu-west-1b
eu-west-1b
eu-west-1a
eu-west-1b
Elastic Load Balancereu-west-1a   eu-west-1b                          Web servers                          Amazon RDS
Recovery from   failure
Autohealing & autoscaling
ELBCloudWatch Autoscaling
Elastic Load Balancer          Autoscaling groupMetrics          CloudWatch
Elastic Load Balancer          Autoscaling groupMetrics          CloudWatch
Elastic Load Balancer          Autoscaling groupMetrics          CloudWatch          Autoscaling service
Elastic Load Balancer          Autoscaling groupMetrics          CloudWatch          Autoscaling service
Elastic Load Balancer          Autoscaling groupMetrics          CloudWatch          Autoscaling service
as-create-launch-config     PHPLaunchConfig     --image-id ami-132216677     --instance-type m1.large     --key amazon-web...
as-create-auto-scaling-group PHPScalingGroup --launch-configuration PHPLaunchConfig --availability-zones eu-west-1a, eu-we...
as-create-or-update-trigger       CPUUtlization       DiskReadBytes        DiskReadOps      DiskWriteBytes       DiskWrite...
Automation
Custom AMIs
CloudFormation
Bootstrap
Configurationmanagement
Elastic Load Balancereu-west-1a   eu-west-1b                          Auto-scaling                          web servers   ...
Elastic Load Balancereu-west-1a   eu-west-1b                          Auto-scaling                          web servers   ...
Extra I G H A V A I L A B I L I T Y W I T H E C 2    Hcredit!    Performance
Horizontal layers  are flexible
Add caching
HTTP cacheWeb serversApplication serversData cacheData store
HTTP cacheWeb serversApplication serversData cacheData store
Varnish:HTTP reverse proxy
Memcached:key/value store
May requireapplication refactor
Custom metrics
AGENDA    High Performance Websites1. Availability2. Static content3. Multi-tier applications4 . Per formance boost5. Summ...
Importance ofhigh availability
Hosting assets on  Amazon S3
Content distribution with Amazon CloudFront
Hosting static web content on S3 and CloudFront
Web applications on  Amazon EC2
Designing for availability
Multi-tier application        hosting
Database management  with Amazon RDS
Slides + videoavailable soon
Thank you!
Q U E S T I O N S     +     C O M M E N T Smatthew@amazon.com              @mza              O N   T W I T T E R
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
High-Availability Websites and Web Applications with AWS
Upcoming SlideShare
Loading in...5
×

High-Availability Websites and Web Applications with AWS

3,127

Published on

Published in: Technology

Transcript of "High-Availability Websites and Web Applications with AWS"

  1. 1. High Availability Websites Matt Wood T E C H N O L O G Y E VA N G E L I S T
  2. 2. AGENDA High Performance Websites: Part 11. Availability2. Static content3. Multi-tier applications4 . Per formance boost5. Summar y
  3. 3. Spectrum of websites
  4. 4. Static DynamicSpectrum of websites
  5. 5. Static DynamicSimple Complex Spectrum of websites
  6. 6. Static DynamicSimple ComplexNiche Mass market Spectrum of websites
  7. 7. Availability is important
  8. 8. Support your customers
  9. 9. Support your business
  10. 10. However...
  11. 11. “Everything fails all the time ” Werner Vogels, Amazon CTO
  12. 12. Infrastructure services cansave the day
  13. 13. Focus on your stuff
  14. 14. Patterns foravailability
  15. 15. 1. Static content
  16. 16. ImagesStylesheets Streaming content Assets Video Javascript
  17. 17. Templates ImagesStylesheets Streaming content Webpages Assets Blog posts Video Javascript PDFs
  18. 18. High Highredundancy availability Amazon S3 High durability
  19. 19. http://s3.amazonaws.com/bucketname/objectid http://bucketname.s3.amazonaws.com/objectid
  20. 20. https://s3.amazonaws.com/bucketname/objectidhttps://bucketname.s3.amazonaws.com/objectid
  21. 21. Perfect for asset hosting
  22. 22. Perfect for website hosting
  23. 23. Let’s see how...
  24. 24. aws.amazon.com/console
  25. 25. Make everything public
  26. 26. index.html Texthttp://mza.s3.amazon.com/site/index.html
  27. 27. https://mza.s3.amazon.com/site/index.html
  28. 28. https://mza.s3.amazon.com/site/index.html
  29. 29. :(
  30. 30. Unfriendly, brittle URL:http://mza.s3.amazonaws.com/s3/index.html
  31. 31. S3 websites
  32. 32. Root objects
  33. 33. Error pages
  34. 34. Let’s see how...
  35. 35. https://my-website.s3-website-eu-west-1.amazon.com
  36. 36. https://my-website.s3-website-eu-west-1.amazon.com
  37. 37. Contentdistribution
  38. 38. Increased latency
  39. 39. CloudFrontPowerful content delivery network
  40. 40. Global edge caching + Friendly URLs
  41. 41. Let’s see how!
  42. 42. d19r58gd5nvk1.cloudfront.net
  43. 43. d19r58gd5nvk1.cloudfront.net/site/index.html
  44. 44. UpdateDNS CNAME
  45. 45. friendly-example.com/index.html
  46. 46. Set CloudFrontDefault Root Object
  47. 47. API or S3 client
  48. 48. CloudBerry Explorer API or S3 client Cyberduck
  49. 49. amazon_s3.html
  50. 50. friendly-example.com
  51. 51. friendly-example.com Global DNS CNAME Global Amazon CloudFront Regional Amazon S3 Redundant storage
  52. 52. 2. Dynamic ormulti-tier content
  53. 53. Ruby on Rails PHP DjangoPerl Dynamic SpringDatabase Java Data store
  54. 54. BlogsE-commerce Gaming DynamicProductivity Apps Social networks
  55. 55. Elastic Multiplecapacity instance sizes Amazon EC2 On-demand
  56. 56. Mastering Multiple failure availability zones High availability Automation and monitoring
  57. 57. H I G H AVA I L A B I L I T Y W I T H E C 2Single server fail over
  58. 58. Elastic IPEC2 instance
  59. 59. Elastic IPEC2 instanceEBS storageEBS snapshot
  60. 60. Elastic IPEC2 instanceEBS storageEBS snapshot
  61. 61. Elastic IPEC2 instanceEBS storageEBS snapshot
  62. 62. Elastic IPEC2 instanceEBS storageEBS snapshot
  63. 63. Cheap, but not ideal
  64. 64. Requires monitoring and automation‘Hot swap’ possible
  65. 65. H I G H AVA I L A B I L I T Y W I T H E C 2 Horizontal redundancy
  66. 66. Applications with multiple tiers
  67. 67. Web serversApplication serversData store
  68. 68. Redundancy at each tier
  69. 69. Web serversApplication serversData store
  70. 70. Tolerant toinstance failure
  71. 71. Web serversApplication serversData store
  72. 72. Tolerant toAZ failure
  73. 73. eu-west-1 eu-west-2 Web servers Application servers Data store
  74. 74. Scale in and out (if you need to)
  75. 75. Web serversApplication serversData store
  76. 76. Load balance
  77. 77. Elastic Load BalancerWeb serversApplication serversData store
  78. 78. Let’s take a look!
  79. 79. Spin up your stack +Prepare for battle!
  80. 80. MySQL server with Amazon RDS
  81. 81. Endpoint
  82. 82. Configure app + cut an AMI
  83. 83. Create Image
  84. 84. Spin uphorizontal layer
  85. 85. 4
  86. 86. http://ec2-46-137-20-114.eu-west-1.compute.amazonaws.com
  87. 87. http://ec2-46-137-20-114.eu-west-1.compute.amazonaws.com
  88. 88. Load balance
  89. 89. Elastic Load BalancerWeb serversAmazon RDS
  90. 90. Elastic Load BalancerWeb serversAmazon RDS
  91. 91. Multiple AZdeployment
  92. 92. Elastic Load Balancereu-west-1a eu-west-1b Web servers Amazon RDS
  93. 93. eu-west-1b
  94. 94. eu-west-1b
  95. 95. eu-west-1a
  96. 96. eu-west-1b
  97. 97. Elastic Load Balancereu-west-1a eu-west-1b Web servers Amazon RDS
  98. 98. Recovery from failure
  99. 99. Autohealing & autoscaling
  100. 100. ELBCloudWatch Autoscaling
  101. 101. Elastic Load Balancer Autoscaling groupMetrics CloudWatch
  102. 102. Elastic Load Balancer Autoscaling groupMetrics CloudWatch
  103. 103. Elastic Load Balancer Autoscaling groupMetrics CloudWatch Autoscaling service
  104. 104. Elastic Load Balancer Autoscaling groupMetrics CloudWatch Autoscaling service
  105. 105. Elastic Load Balancer Autoscaling groupMetrics CloudWatch Autoscaling service
  106. 106. as-create-launch-config PHPLaunchConfig --image-id ami-132216677 --instance-type m1.large --key amazon-web --group "Web and SSH"
  107. 107. as-create-auto-scaling-group PHPScalingGroup --launch-configuration PHPLaunchConfig --availability-zones eu-west-1a, eu-west-1b --min-size 10 --max-size 10 --load-balancers lamp-load-balancer
  108. 108. as-create-or-update-trigger CPUUtlization DiskReadBytes DiskReadOps DiskWriteBytes DiskWriteOps NetworkIn NetworkOut DatabaseConnections FreeStorageSpace ReadLatency ReadThroughput SwapUsage WriteLatency
  109. 109. Automation
  110. 110. Custom AMIs
  111. 111. CloudFormation
  112. 112. Bootstrap
  113. 113. Configurationmanagement
  114. 114. Elastic Load Balancereu-west-1a eu-west-1b Auto-scaling web servers Amazon RDS
  115. 115. Elastic Load Balancereu-west-1a eu-west-1b Auto-scaling web servers MySQL Amazon RDS
  116. 116. Extra I G H A V A I L A B I L I T Y W I T H E C 2 Hcredit! Performance
  117. 117. Horizontal layers are flexible
  118. 118. Add caching
  119. 119. HTTP cacheWeb serversApplication serversData cacheData store
  120. 120. HTTP cacheWeb serversApplication serversData cacheData store
  121. 121. Varnish:HTTP reverse proxy
  122. 122. Memcached:key/value store
  123. 123. May requireapplication refactor
  124. 124. Custom metrics
  125. 125. AGENDA High Performance Websites1. Availability2. Static content3. Multi-tier applications4 . Per formance boost5. Summar y
  126. 126. Importance ofhigh availability
  127. 127. Hosting assets on Amazon S3
  128. 128. Content distribution with Amazon CloudFront
  129. 129. Hosting static web content on S3 and CloudFront
  130. 130. Web applications on Amazon EC2
  131. 131. Designing for availability
  132. 132. Multi-tier application hosting
  133. 133. Database management with Amazon RDS
  134. 134. Slides + videoavailable soon
  135. 135. Thank you!
  136. 136. Q U E S T I O N S + C O M M E N T Smatthew@amazon.com @mza O N T W I T T E R

×