Websites on AWS

2,029 views
1,958 views

Published on

An introduction to building highly available web applications on AWS.

Published in: Technology, Business
0 Comments
4 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,029
On SlideShare
0
From Embeds
0
Number of Embeds
314
Actions
Shares
0
Downloads
19
Comments
0
Likes
4
Embeds 0
No embeds

No notes for slide

Websites on AWS

  1. 1. E P I S O D E 2 High Availability Websites
  2. 2. AGENDA High Performance Websites1. 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. “Everything fails all the time ” Werner Vogels, Amazon CTO
  11. 11. Infrastructure services cansave the day
  12. 12. Design foravailability
  13. 13. Implement on AWS
  14. 14. Focus on your stuff
  15. 15. Patterns foravailability
  16. 16. 1. Static content
  17. 17. ImagesStylesheets Streaming content Assets Video Javascript
  18. 18. Templates ImagesStylesheets Streaming content Webpages Assets Blog posts Video Javascript PDFs
  19. 19. High Highredundancy availability Amazon S3 High durability
  20. 20. http://s3.amazonaws.com/bucketname/objectid http://bucketname.s3.amazonaws.com/objectid
  21. 21. https://s3.amazonaws.com/bucketname/objectidhttps://bucketname.s3.amazonaws.com/objectid
  22. 22. Perfect for asset hosting
  23. 23. Perfect for website hosting
  24. 24. Let’s take a look...
  25. 25. aws.amazon.com/console
  26. 26. Make everything public
  27. 27. index.html Texthttp://mza.s3.amazon.com/site/index.html
  28. 28. https://mza.s3.amazon.com/site/index.html
  29. 29. https://mza.s3.amazon.com/site/index.html
  30. 30. :(
  31. 31. Unfriendly, brittle URL:http://mza.s3.amazonaws.com/s3/index.html
  32. 32. S3 websites
  33. 33. Root objects
  34. 34. Error pages
  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. d19r58gd5nvk1.cloudfront.net
  42. 42. d19r58gd5nvk1.cloudfront.net/site/index.html
  43. 43. UpdateDNS CNAME
  44. 44. friendly-example.com/index.html
  45. 45. Set CloudFrontDefault Root Object
  46. 46. API or S3 client
  47. 47. CloudBerry Explorer API or S3 client Cyberduck
  48. 48. amazon_s3.html
  49. 49. friendly-example.com
  50. 50. friendly-example.com Global DNS CNAME Global Amazon CloudFront Regional Amazon S3 Redundant storage
  51. 51. 2. Dynamic ormulti-tier content
  52. 52. Ruby on Rails PHP DjangoPerl Dynamic SpringDatabase Java Data store
  53. 53. BlogsE-commerce Gaming DynamicProductivity Apps Social networks
  54. 54. Elastic Multiplecapacity instance sizes Amazon EC2 On-demand
  55. 55. Mastering Multiple failure availability zones High availability Automation and monitoring
  56. 56. H I G H AVA I L A B I L I T Y W I T H E C 2Rapid replacement
  57. 57. Elastic IPEC2 instance
  58. 58. Elastic IPEC2 instanceEBS storageEBS snapshot
  59. 59. Elastic IPEC2 instanceEBS storageEBS snapshot
  60. 60. Elastic IPEC2 instanceEBS storageEBS snapshot
  61. 61. Elastic IPEC2 instanceEBS storageEBS snapshot
  62. 62. Great for updates, too
  63. 63. Requires monitoring and automation‘Hot swap’ possible
  64. 64. H I G H AVA I L A B I L I T Y W I T H E C 2 Horizontal redundancy
  65. 65. Applications with multiple tiers
  66. 66. Web serversApplication serversData store
  67. 67. Redundancy at each tier
  68. 68. Web serversApplication serversData store
  69. 69. Tolerant toinstance failure
  70. 70. Web serversApplication serversData store
  71. 71. Tolerant toAZ failure
  72. 72. eu-west-1 eu-west-2 Web servers Application servers Data store
  73. 73. Scale in and out (if you need to)
  74. 74. Web serversApplication serversData store
  75. 75. Load balance
  76. 76. Elastic Load BalancerWeb serversApplication serversData store
  77. 77. Let’s take a look!
  78. 78. Spin up a LAMP stack +Prepare for battle!
  79. 79. yum install apache yum install php yum install git git clone <app>
  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. Multiple AZdeployment
  91. 91. eu-west-1b
  92. 92. eu-west-1b
  93. 93. eu-west-1a
  94. 94. eu-west-1b
  95. 95. Elastic Load Balancereu-west-1a eu-west-1b Web servers Amazon RDS
  96. 96. Recovery from failure
  97. 97. Auto-healing & autoscaling
  98. 98. ELBCloudWatch Autoscaling
  99. 99. as-create-launch-config PHPLaunchConfig --image-id ami-132216677 --instance-type m1.large --key amazon-web --group "Web and SSH"
  100. 100. 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
  101. 101. as-create-or-update-trigger CPUUtlization DiskReadBytes DiskReadOps DiskWriteBytes DiskWriteOps NetworkIn NetworkOut DatabaseConnections FreeStorageSpace ReadLatency ReadThroughput SwapUsage WriteLatency
  102. 102. Elastic Load Balancereu-west-1a eu-west-1b Auto-scaling web servers Amazon RDS
  103. 103. Elastic Load Balancereu-west-1a eu-west-1b Auto-scaling web servers MySQL Amazon RDS
  104. 104. H I G H AVA I L A B I L I T Y W I T H E C 2 Datastore availability
  105. 105. Common singlepoint of failure
  106. 106. Performance bottleneck
  107. 107. Amazon RDS
  108. 108. Multi-AZfail over
  109. 109. Multi-AZ Deployment
  110. 110. Synchronous writes
  111. 111. Monitored state
  112. 112. Automatic restore on failure
  113. 113. Elastic Load Balancereu-west-1a eu-west-1b Auto-scaling web servers Amazon RDS
  114. 114. 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
  115. 115. Horizontal layers are flexible
  116. 116. Add caching
  117. 117. HTTP cacheWeb serversApplication serversData cacheData store
  118. 118. HTTP cacheWeb serversApplication serversData cacheData store
  119. 119. Varnish:HTTP reverse proxy
  120. 120. Memcached:key/value store
  121. 121. ElastiCache
  122. 122. Resilient caching clusters
  123. 123. Amazon RDSread replicas
  124. 124. AGENDA High Performance Websites1. Availability2. Static content3. Multi-tier applications4 . Per formance boost5. Summar y
  125. 125. Thank you!
  126. 126. QUESTIONS + FEEDBACK:matthew@amazon.com @mza O N T W I T T E R

×