• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Best Practices for Hosting Web Applications on AWS
 

Best Practices for Hosting Web Applications on AWS

on

  • 3,588 views

 

Statistics

Views

Total Views
3,588
Views on SlideShare
3,587
Embed Views
1

Actions

Likes
7
Downloads
0
Comments
0

1 Embed 1

http://blog.v2valley.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Best Practices for Hosting Web Applications on AWS Best Practices for Hosting Web Applications on AWS Presentation Transcript

    • Best Practices For Hosting Web Applications on AWS Jeff Barr Senior Web Services Evangelist @jeffbarr Matt Tavis Solutions Architect
    • 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 However…
    • 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 Assets Blog posts PDFs Javascript Videos
    • High HighRedundancy Availability Amazon S3 High durability
    • 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
    • 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 Let’s see how…
    • 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 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
    • Update DNS Entry www.jeff-barr.com
    • What We Have Built www.jeff-barr.com Global DNS CNAME Global Amazon CloudFront Regional Amazon S3 Redundant storage
    • Pattern 2Dynamic or Multi-Tier Content
    • Ruby on Rails PHP DjangoPerl Dynamic Spring Database Data store
    • Blogs E-commerce Gaming Dynamic AppsProductivity Social networks
    • Elastic MultipleCapacity Instance Sizes Amazon EC2 On-demand
    • Mastering Multiple failure availability zones High Availability Automation and monitoring
    • High Availability With EC2 Single Server Fail Over
    • High Availability With EC2 Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
    • Instance Failure Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
    • Instance Failure – Replace Instance Elastic IP Address EC2 Instance EC2 Instance EBS Storage EBS Snapshot
    • Instance Failure –Back to Normal Elastic IP Address EC2 Instance EBS Storage EBS Snapshot
    • 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 Web Servers Application Servers Application Servers Application Servers Data Store Data Store Data Store
    • This Architecture Tolerates Instance Failure Web Servers Web Servers Web Servers Application Servers Application Servers Application Servers Data Store Data Store Data Store
    • 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
    • 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
    • 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-key --group “Web and SSH”
    • 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!
    • Set Scaling Rulesas-create-or-update-trigger CPUUtilization DiskReadBytes DiskReadOps DiskWriteBytes DiskWriteOps NetworkIn NetworkOut FreeStorageSpace ReadLatency …
    • SummaryWhat We Have Seen and Learned
    • 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
    • Q&A
    • Thank You!