• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
AWS Webcast - Scaling on AWS for the First 10 Million Users
 

AWS Webcast - Scaling on AWS for the First 10 Million Users

on

  • 2,129 views

Learn about the patterns and techniques a business should be using in building their infrastructure on Amazon Web Services to be able to handle rapid growth and success in the early days. From ...

Learn about the patterns and techniques a business should be using in building their infrastructure on Amazon Web Services to be able to handle rapid growth and success in the early days. From leveraging highly scalable AWS services, to architecting best patterns, there are a number of smart choices you can make early on to help you overcome some typical infrastructure issues.

Statistics

Views

Total Views
2,129
Views on SlideShare
1,924
Embed Views
205

Actions

Likes
7
Downloads
134
Comments
0

3 Embeds 205

http://www.scoop.it 201
https://twitter.com 3
http://webcache.googleusercontent.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

    AWS Webcast - Scaling on AWS for the First 10 Million Users AWS Webcast - Scaling on AWS for the First 10 Million Users Presentation Transcript

    • Scaling on AWS for the First 10 Million Users• ME: Chris Munns – Solutions Architect – Amazon WebServices – munns@amazon.com• YOU: Here to learn more about scaling infrastructureon AWS• TODAY: about best practices and things to think aboutwhen building for large scale
    • So how do we scale?
    • a lot of things to read
    • not where we want to starta lot of things to read
    • Auto-Scaling is a tool and adestination. It’s not thesingle thing that fixeseverything.
    • What do we need first?
    • Some basics:
    • US-WEST (Oregon)EU-WEST (Ireland)ASIA PAC (Tokyo)US-WEST (N. California)SOUTH AMERICA (Sao Paulo)US-EAST (Virginia)AWS GovCloud (US)ASIA PAC(Sydney)RegionsASIA PAC(Singapore)
    • US-WEST (Oregon)EU-WEST (Ireland)ASIA PAC (Tokyo)US-WEST (N. California)SOUTH AMERICA (Sao Paulo)US-EAST (Virginia)AWS GovCloud (US)ASIA PAC(Sydney)Availability ZonesASIA PAC(Singapore)
    • • $5.2B retail business• 7,800 employees• A whole lot of serversEvery day, AWS adds enoughserver capacity to power thatwhole $5B enterprise
    • Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworking
    • Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworkingAmazonCloudWatch AWS IAM AWSCloudFormationAmazon ElasticBeanstalkAWSDataPipelineAWSOpsWorksAmazonCloudSearchAmazon SQSAmazonSNSAmazonElasticTranscoderAmazon SWFAmazon SESAmazonDynamoDBAmazon RDSAmazonElastiCacheAmazonRedShiftAWS StorageGatewayAmazon S3AmazonGlacierAmazonCloudFrontAmazonEC2AmazonEMRAmazonVPCAmazonRoute 53AWSDirectConnect
    • So let’s start from dayone, user one ( you ):
    • Day One, User One:• A single EC2 Instance– With full stack on this host• Web App• Database• Management• etc• A single Elastic IP• Route53 for DNSEC2InstanceElastic IPAmazonRoute 53User
    • “We’re gonna need a bigger box”• Simplest approach• Can now leverage PIOPs• High I/O instances• High Memory instances• High CPU instances• High storage instances• Easy to change instance sizes• Will hit an endpoint eventuallyhi1.4xlargem2.4xlargem1.small
    • Day One, User One:• We could potentially getto a few hundred to a fewthousand depending onapplication complexityand traffic• No failover• No redundancy• Too many eggs in onebasketEC2InstanceElastic IPAmazonRoute 53User
    • Day Two, User >1:First lets separate outour single host intomore than one.• Web• Database– Make use of a databaseservice?WebInstanceDatabaseInstanceElastic IPAmazonRoute 53User
    • Self-Managed Fully-ManagedDatabase Serveron Amazon EC2Your choice ofdatabase running onAmazon EC2BringYour OwnLicense (BYOL)AmazonDynamoDBManaged NoSQLdatabase serviceusing SSD storageSeamlessscalability ZeroadministrationAmazon RDSMicrosoft SQL,Oracle or MySQL asa managed serviceFlexible licensingBYOL or LicenseIncludedAmazonRedshiftMassively parallel,petabyte-scale,data warehouseserviceFast, powerful andeasy to scaleDatabase Options
    • But how do I choosewhat DB technology Ineed? SQL? NoSQL?
    • Some folks won’t likethis. But…
    • Start with SQLdatabases
    • But, but, but, but…
    • No.You don’t.
    • Start with SQLdatabases
    • Why start with SQL?• Established and well worn technology• Lots of existing code, communities, books,background, tools, etc• You aren’t going to break SQL DBs in your first 10million users. No really, you won’t*• Clear patterns to scalability*Unless you are doing something SUPER weird with the data orMASSIVE amounts of it, even then SQL will have a place in your stack
    • AH HA! You said “massiveamounts”, I will havemassive amounts!
    • If your usage is such that youwill be generating several TB(>5 ) of data in the first year ORhave an incredibly dataintensive work load you mightneed NoSQL
    • But this is probablyless than 90% of you
    • User >100:First lets separate outour single host intomore than one.• Web• Database– Use RDS to make your lifeeasierWebInstanceElastic IPRDS DBInstanceAmazonRoute 53User
    • User > 1000:Next let’s address ourlack of failover andredundancy issues:• Elastic Load Balancer• Another Web instance– In another Availability Zone• Enable RDS Multi-AZWebInstanceRDS DB InstanceActive (Multi-AZ)Availability Zone Availability ZoneWebInstanceRDS DB InstanceStandby (Multi-AZ)Elastic LoadBalancerAmazonRoute 53User
    • • Create highly scalable applications• Distribute load across EC2 instancesin multiple availability zonesFeature DetailsAvailable Load balance across instances in multipleAvailability ZonesHealth checks Automatically checks health of instances andtakes them in or out of serviceSession stickiness Route requests to the same instanceSecure sockets layer Supports SSL offload from web and applicationservers with flexible cipher supportMonitoring Publishes metrics to CloudWatchElastic LoadBalancerElastic Load Balancing
    • Scaling this horizontallyand vertically here willget us pretty far( 10s-100s of thousands )
    • User >10ks-100ks:RDS DB InstanceActive (Multi-AZ)Availability Zone Availability ZoneRDS DB InstanceStandby (Multi-AZ)Elastic LoadBalancerRDS DB InstanceRead ReplicaRDS DB InstanceRead ReplicaRDS DB InstanceRead ReplicaRDS DB InstanceRead ReplicaWebInstanceWebInstanceWebInstanceWebInstanceWebInstanceWebInstanceWebInstanceWebInstanceAmazonRoute 53User
    • This will take us pretty farhonestly, but we care aboutperformance and efficiency,so lets clean this up a bit
    • Shift some load around:Let’s lighten the load onour web and databaseinstances a bit:• Move static content fromwebs to S3 and CloudFront• Move session/state and DBcaching to ElastiCache orDynamoDBWebInstanceRDS DB InstanceActive (Multi-AZ)Availability ZoneElastic LoadBalancerAmazon S3AmazonCloudfrontAmazonRoute 53UserElastiCacheDynamoDB
    • Working with S3 - Amazon Simple Storage Service• Object based storage for the web• 11 9s of durability• Good for things like:– Static assets ( css, js, images,videos )– Backups– Logs– Ingest of files for processing• “Infinitely scalable”• Supports fine grained permissioncontrol• Ties in well with CloudFront• Ties in with EMR• Acts as a logging endpoint forS3/CloudFront/Billing• Supports Encryption at transit and atrest• Reduced Redundancy 1/3 cheaper• Glacier for super long term storage
    • DynamoDB• Provisioned throughput NoSQLdatabase• Fast, predictable performance• Fully distributed, fault tolerantarchitecture• Considerations for non-uniformdataFeature DetailsProvisionedthroughputDial up or down provisionedread/write capacity.PredictableperformanceAverage single digit millisecondlatencies from SSD-backedinfrastructure.StrongconsistencyBe sure you are reading themost up to date values.Fault tolerant Data replicated acrossAvailability Zones.Monitoring Integrated to CloudWatch.Secure Integrates with AWS Identityand Access Management (IAM).ElasticMapReduceIntegrates with ElasticMapReduce for complexanalytics on large datasets.
    • ElastiCache• Hosted Memcached– Speaks same API as traditional open sourcememcached• Scale from one to many nodes• Self healing ( replaces dead instance )• Very fast ( single digit ms speeds usually (or less) )• Local to a single AZ– So need to run different clusters across different Azs• Data is only in memory, so not persistent• Use AWS’s Auto Discovery client to simplify clustersgrowing and shrinking without affecting your application
    • Now that our Web tier ismuch more light weight, wecan revisit the beginning ofour talk..
    • Auto-Scaling!
    • Automatic resizing of computeclusters based on demandTrigger auto-scalingpolicyFeature DetailsControl Define minimum and maximum instance poolsizes and when scaling and cool down occurs.Integrated to AmazonCloudWatchUse metrics gathered by CloudWatch to drivescaling.Instance types Run Auto Scaling for On-Demand and SpotInstances. Compatible with VPC.as-create-auto-scaling-group MyGroup--launch-configuration MyConfig--availability-zones us-east-1a--min-size 4--max-size 200Auto-ScalingAmazonCloudWatch
    • Sunday Monday Tuesday Wednesday Thursday Friday SaturdayTypical weekly traffic to Amazon.com
    • Sunday Monday Tuesday Wednesday Thursday Friday SaturdayTypical weekly traffic to Amazon.comProvisioned capacity
    • November traffic to Amazon.comNovember
    • November traffic to Amazon.comProvisioned capacityNovember
    • November traffic to Amazon.com76%24%Provisioned capacityNovember
    • November traffic to Amazon.comNovember
    • Auto-Scaling lets you do this!
    • There’s furtherimprovements to be madein breaking apart ourweb/app layer more
    • SOA = Service Oriented Architecture
    • SOA’ingMove services into their owntiers/modules.Treat each ofthese as 100% whole-y separatepieces of your infrastructure andscale them independently.Amazon.com and AWS do thisextensively! It offers flexibilityand greater understanding ofeach component
    • Loose coupling sets you free!• The looser theyre coupled, the biggerthey scale– Independent components– Design everything as a black box– Decouple interactions– Favor services with built in redundancy andscalability than building your ownController A Controller BController A Controller BQ QTight CouplingUse Amazon SQS as BuffersLoose Coupling
    • Loose coupling + SOA = winningIn the early days, if someone has a service forit already, opt to use that instead of building ityourself. DON’T REINVENT THE WHEELExamples:• Email• Queuing• Transcoding• Search• Databases• Monitoring• Metrics• LoggingAmazonCloudSearchAmazon SQSAmazon SNSAmazon ElasticTranscoderAmazon SWFAmazon SES
    • On re-inventing the wheel: ifyou find yourself writingyour own: queue, DNSserver, database, storagesystem, monitoring tool
    • Take a deep breath and stopit. Now.
    • Back to SOA
    • Imagine we let our usersupload photos
    • S3 BucketFor IngestUserSNS TopicRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributionSQS QueueSize for ThumbnailSQS QueueSize Image forMobileSQS QueueSize Image for WebAuto scalingGroupInstancesAuto scalingGroupInstancesAuto scalingGroupInstances
    • User >1mil+:Reaching a million and above is going to require some bitof all the previous things:• Multi-AZ• Elastic Load Balancer between tiers• Auto-Scaling• Service oriented architecture• Serving content smartly ( S3/CloudFront )• Caching off DB• Moving state off tiers that auto-scale
    • User >1mil+:RDS DB InstanceActive (Multi-AZ)Availability ZoneElastic LoadBalancerRDS DB InstanceRead ReplicaRDS DB InstanceRead ReplicaWebInstanceWebInstanceWebInstanceWebInstanceAmazonRoute 53UserAmazon S3AmazonCloudfrontDynamoDBAmazon SQSElastiCacheWorkerInstanceWorkerInstanceAmazonCloudWatchInternal AppInstanceInternal AppInstanceAmazon SES
    • The next big steps
    • User >5mil – 10mil:You’ll potentially start to run into issues with yourdatabase around contention on the write master.How can you solve it?• Federation ( splitting into multiple DBs based onfunction)• Sharding ( splitting one data set up across multiplehosts)• Moving some functionality to other types of DBs (NoSQL )
    • Database Federation• Split up Databases byfunction/purpose• Harder to do cross functionqueries• Essentially delaying the needfor something likesharding/NoSQL until muchfurther down the line• Won’t help with single hugefunctions/tablesForumsDBUsersDBProductsDB
    • Sharded Horizontal Scaling• More complex at theapplication layer• ORM support can help• No practical limit on scalability• Operationcomplexity/sophistication• Shard by function or key space• RDBMS or NoSQLUser ShardID002345 A002346 B002347 C002348 B002349 AABC
    • User >5mil – 10mil:You’ll potentially start to run into issues with speed andperformance of your applications.• Need to make sure you havemonitoring/metrics/logging in place– If you can’t build it internally, out source it! ( 3rd party SaaS )• Pay attention to what customers are saying works wellvs what doesn’t• Really try to work on squeezing as much performanceout of each service/component
    • HOSTLEVELMETRICSAGGREGATELEVELMETRICSLOGANALYSISEXTERNALSITEPERFORMANCE
    • Not having propermonitoring/metrics is likeflying a plane with an eye maskon in a thunderstorm. Oh andyour wing is on fire.
    • AWS Marketplace & Partners can help• Customer can find, research, buysoftware• Simple pricing, aligns with EC2 usagemodel• Launch in minutes• Marketplace billing integrated into yourAWS account• 700+ products across 20+ categoriesLearn more at: aws.amazon.com/marketplace
    • User >5mil – 10mil:Managing your infrastructure will become an everincreasing important part of your time. Use tools toautomate repetitive tasks.• Tools to manage AWS resources• Tools to manage software and configuration on yourinstances• Automated data analysis of logs and user actions
    • AWS Application Management SolutionsElastic Beanstalk OpsWorks CloudFormation EC2Convenience ControlHigher-level Services Do it yourself
    • Host based Configuration ManagementTwo big players:– Opscode Chef– PuppetLabs Puppet• Both do more or less the same thing• Both have syntax that isn’t too dissimilar• Use these one of these along side one of the toolsfrom the previous slide• Spend the time required to learn them• Can’t scale easily with out something like this
    • A quick review:
    • • Multi-AZ your infrastructure• Make use of self scaling services ( ELB, S3, SNS, SQS, SWF,SES, etc )• Build in redundancy at every level.• Start SQL. Seriously.• Move to NoSQL if it really makes sense• Leverage managed/low touch services• Split tiers into individual services ( SOA )• Use Auto-scaling once you’re ready to• Use automation tools in your infrastructure• Make sure you have good metrics/monitoring/logging toolsin place• Don’t reinvent the wheel
    • Putting all this togethermeans we should now easilybe able to handle 10+million users!
    • To infinity…..
    • User >10mil:A lot of what we covered today willget you potentially into the high 10s ofmillions. Iterating on top of thepatterns seen here will get you up andover 100 million users.
    • User >10mil:• More fine tuning of your application• More SOA of features/functionality• Going from Multi-AZ to Multi-Region• Needing to start potentially buildingcustom solutions• Deep analysis of your whole stack
    • Next steps?READ! –• aws.amazon.com/documentation• aws.amazon.com/architecture• aws.amazon.com/start-ups
    • Next steps?START USING AWS –aws.amazon.com/free/
    • Next steps?ASK FOR HELP!• forums.aws.amazon.com• aws.amazon.com/supportYour local account manager!
    • THANKS F0R LISTENING!Chris Munns - munns@amazon.com