Philly Tech Week 2013
Scaling on AWS for the First 10 Million Users• ME: Chris Munns – Solutions Architect – Amazon WebServices – munns@amazon.c...
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 Gov...
US-WEST (Oregon)EU-WEST (Ireland)ASIA PAC (Tokyo)US-WEST (N. California)SOUTH AMERICA (Sao Paulo)US-EAST (Virginia)AWS Gov...
• $5.2B retail business• 7,800 employees• A whole lot of serversEvery day, AWS adds enoughserver capacity to power thatwho...
Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworking
Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworkingAmazonCloudWatch AWS IAM ...
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 Elas...
“We’re gonna need a bigger box”• Simplest approach• Can now leverage PIOPs• High I/O instances• High Memory instances• Hig...
“We’re gonna need a bigger box”• Simplest approach• Can now leverage PIOPs• High I/O instances• High Memory instances• Hig...
Day One, User One:• We could potentially getto a few hundred to a fewthousand depending onapplication complexityand traffi...
Day One, User One:• We could potentially getto a few hundred to a fewthousand depending onapplication complexityand traffi...
Day Two, User >1:First lets separate outour single host intomore than one.• Web• Database– Make use of a databaseservice?W...
Self-Managed Fully-ManagedDatabase Serveron Amazon EC2Your choice ofdatabase running onAmazon EC2BringYour OwnLicense (BYO...
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, et...
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 dataintens...
But this is probablyless than 90% of you
Unless everyone of you isbuilding semantic/bigdata websites
User >100:First lets separate outour single host intomore than one.• Web• Database– Use RDS to make your lifeeasierWebInst...
User > 1000:Next let’s address ourlack of failover andredundancy issues:• Elastic Load Balancer• Another Web instance– In ...
• Create highly scalable applications• Distribute load across EC2 instancesin multiple availability zonesFeature DetailsAv...
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)Elast...
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 a...
Working with S3 - Amazon Simple Storage Service• Object based storage for the web• 11 9s of durability• Good for things li...
DynamoDB• Provisioned throughput NoSQLdatabase• Fast, predictable performance• Fully distributed, fault tolerantarchitectu...
ElastiCache• Hosted Memcached– Speaks same API as traditional open sourcememcached• Scale from one to many nodes• Self hea...
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 m...
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 let’s 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 ...
Loose coupling sets you free!• The looser theyre coupled, the biggerthey scale– Independent components– Design everything ...
Loose coupling + SOA = winningIn the early days, if someone has a service forit already, opt to use that instead of buildi...
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 BucketFororiginalsCloudFrontDownloadDistributio...
Amazon Simple Workflow (SWF)• Orchestration tool across your infrastructure• Use it as a middle layer to pass messages and...
S3 BucketFor IngestUserSNS TopicRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributio...
S3 BucketFor IngestUserRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributionAuto sca...
User >1mil+:Reaching a million and above is going to require some bitof all the previous things:• Multi-AZ• Elastic Load B...
User >1mil+:RDS DB InstanceActive (Multi-AZ)Availability ZoneElastic LoadBalancerRDS DB InstanceRead ReplicaRDS DB Instanc...
The next big steps
User >5mil – 10mil:You’ll potentially start to run into issues with yourdatabase around contention on the write master.How...
Database Federation• Split up Databases byfunction/purpose• Harder to do cross functionqueries• Essentially delaying the n...
Sharded Horizontal Scaling• More complex at theapplication layer• ORM support can help• No practical limit on scalability•...
User >5mil – 10mil:You’ll potentially start to run into issues with speed andperformance of your applications.• Need to ma...
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•...
User >5mil – 10mil:Managing your infrastructure will become an everincreasing important part of your time. Use tools toaut...
AWS Application Management SolutionsElastic Beanstalk OpsWorks CloudFormation EC2Convenience ControlHigher-level Services ...
Host based Configuration ManagementTwo big players:– Opscode Chef– PuppetLabs Puppet• Both do more or less the same thing•...
A quick review:
• Multi-AZ your infrastructure• Make use of self scaling services ( ELB, S3, DynamoDB, SQS,SWF, SES, etc )• Build in redun...
Putting all this togethermeans we should now easilybe able to handle 10+million users!
a few words of caution onwhat not to waste time on…
programming languages
the latest and greatest
copying the tech stack ofany other company
getting too big for yourbritches
To infinity…..
User >10mil:A lot of what we covered today willget you potentially into the high 10s ofmillions. Iterating on top of thepa...
User >10mil:• More fine tuning of your application• More SOA of features/functionality• Going from Multi-AZ to Multi-Regio...
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/supportYou’re local account manager!-Will Hanft - williah@...
THANKS F0R LISTENING!Chris Munns - munns@amazon.comThanks also to First Round, Dorm Room Fund,Gabriel Weinberg, and Techni...
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
Scaling on AWS for the First 10 Million Users
Upcoming SlideShare
Loading in...5
×

Scaling on AWS for the First 10 Million Users

12,203

Published on

Published in: Technology
0 Comments
44 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
12,203
On Slideshare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
243
Comments
0
Likes
44
Embeds 0
No embeds

No notes for slide
  • http://picturephilly.com/wp-content/uploads/2010/11/philadelphia-skyline-from-south-street-bridge2.jpg
  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
  • http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html
  • This is a point of reference about our scale- in 2003, Amazon.com was a $5+ Billion technology powered retail business. When we measured the capacity growth rate of our current AWS environments, we found that we add enough server capacity to power all of the 2003 era Amazon business, EVERY DAY.As an additional point of comparison, $5Billion revenue puts you right around 400 in the Fortune 500- that means that we’re adding enough capacity to power a pretty big stand alone company- For some perspective on this, some examples of companies with revenues right around $5 Billion include Charles Schwab, Clorox, Harley Davidson and VMWare.
  • Over 30 services
  • Over 30 services, the 25 major services as seen in the console
  • 18 instance types
  • 18 instance types
  • 18 instance types
  • Amazon EC2 enables our partners and customers to build and customize Amazon Machine Images (AMIs) with software based on your needs. These are the database servers available for use today within Amazon EC2: Oracle Database 11g,Microsoft SQL Server Standard,MySQL Enterprise,IBM DB2,IBM Informix Dynamic Server. http://aws.amazon.com/ec2/Amazon Relational Database Service (Amazon RDS) is a web service that makes it easy to set up, operate, and scale a relational database in the cloud. It provides cost-efficient and resizable capacity while managing time-consuming database administration tasks, freeing you up to focus on your applications and business. Amazon RDS gives you access to the capabilities of a familiar MySQL or Oracle database. This means that the code, applications, and tools you already use today with your existing databases can be used with Amazon RDS. Amazon RDS automatically patches the database software and backs up your database, storing the backups for a user-defined retention period and enabling point-in-time recovery. You benefit from the flexibility of being able to scale the compute resources or storage capacity associated with your relational database instance via a single API call. In addition, Amazon RDS for MySQL makes it easy to use replication to enhance availability and reliability for production databases and to scale out beyond the capacity of a single database deployment for read-heavy database workloads. As with all Amazon Web Services, there are no up-front investments required, and you pay only for the resources you use. http://aws.amazon.com/rds/Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. With a few clicks in the AWS Management Console, customers can launch a new Amazon DynamoDB database table, scale up or down their request capacity for the table without downtime or performance degradation, and gain visibility into resource utilization and performance metrics. Amazon DynamoDB enables customers to offload the administrative burdens of operating and scaling distributed databases to AWS, so they don’t have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling. http://aws.amazon.com/dynamodb/Amazon Redshift is a managed data warehouse service in the Amazon cloud. Redshift is optimized for data sets ranging from 100’s of GB to peta-byte scale. It uses columnar storage to compress and accelerate scan operations against large data sets, while providing a SQL interface for easy integration with reporting and query tools. All Redshift operations occur as massively parallel processes, including data loading, query, resizing, backup and restore. Redshift users can provision a cluster and load data directly from S3 in a few minutes, and be assured that their data is protected by VPC and encryption, both at rest and in-flight (via SSL).
  • Most of you will get to this point and pretty well off honestly. You can take this really pretty far for most web applications. But we want to be smarter and more efficient than this, and also what about performance?
  • Most of you will get to this point and pretty well off honestly. You can take this really pretty far for most web applications. But we want to be smarter and more efficient than this, and also what about performance?
  • AWS Marketplace is the AWS Online Software Store Customer can find, research, buy software including developer toolsWith AWS Marketplace, the simple hourly pricing of most products aligns with EC2 usage model You can find, purchase and 1-Click launch in minutes, making deployment easyMarketplace billing integrated into your AWS account600+ products across 23 categories including bug tracking, monitoring, source control and testing
  • In general you can say that with Beanstalk and OpsWorks you have higher level services that abstract thingsvs the DIY world of cloudformation and EC2 and friends (cloudwatch, autoscaling, ELB)SO WHY SHOULD SOMEONE USE OPSWORKS
  • Pick one! Two tops! Make sure your entire team can understand whatever languages you go with. Avoid swapping in random new languages unless it overwhelmingly solves a problem you have better than your current languages
  • New open source tech comes out daily. Sometimes from cool companies we love. This doesn’t mean that its for you.
  • Oh? Company xyz.com released their open source fork of mongodb with a plugin to run on squirrels because it solved their scaling during a blue moon problem? This isn’t you.
  • Scale as you need to with an eye for where you think you might end up 6 months from now. Don’t think about 10x unless 10x is 6 months from now. If you have 10GB mysql database, you don’t need Hadoop to scale that. If you are currently ingesting 1000 data points a minute, why are you worrying about 10 million a minute?
  • So, beyond 10mil
  • Scaling on AWS for the First 10 Million Users

    1. 1. Philly Tech Week 2013
    2. 2. 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• TONIGHT: about best practices and things to thinkabout when building for large scale
    3. 3. So how do we scale?
    4. 4. a lot of things to read
    5. 5. not where we want to starta lot of things to read
    6. 6. Auto-Scaling is a tool and adestination. It’s not thesingle thing that fixeseverything.
    7. 7. What do we need first?
    8. 8. Some basics:
    9. 9. 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)
    10. 10. 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)
    11. 11. • $5.2B retail business• 7,800 employees• A whole lot of serversEvery day, AWS adds enoughserver capacity to power thatwhole $5B enterprise
    12. 12. Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworking
    13. 13. Compute StorageAWS Global InfrastructureDatabaseApp ServicesDeployment & AdministrationNetworkingAmazonCloudWatch AWS IAM AWSCloudFormationAmazon ElasticBeanstalkAWSDataPipelineAWSOpsWorksAmazonCloudSearchAmazon SQSAmazonSNSAmazonElasticTranscoderAmazon SWFAmazon SESAmazonDynamoDBAmazon RDSAmazonElastiCacheAmazonRedShiftAWS StorageGatewayAmazon S3AmazonGlacierAmazonCloudFrontAmazonEC2AmazonEMRAmazonVPCAmazonRoute 53AWSDirectConnect
    14. 14. So let’s start from dayone, user one ( you ):
    15. 15. 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
    16. 16. “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
    17. 17. “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
    18. 18. 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
    19. 19. 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
    20. 20. Day Two, User >1:First lets separate outour single host intomore than one.• Web• Database– Make use of a databaseservice?WebInstanceDatabaseInstanceElastic IPAmazonRoute 53User
    21. 21. 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
    22. 22. But how do I choosewhat DB technology Ineed? SQL? NoSQL?
    23. 23. Some folks won’t likethis. But…
    24. 24. Start with SQLdatabases
    25. 25. But, but, but, but…
    26. 26. No.You don’t.
    27. 27. Start with SQLdatabases
    28. 28. 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
    29. 29. AH HA! You said “massiveamounts”, I will havemassive amounts!
    30. 30. 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
    31. 31. But this is probablyless than 90% of you
    32. 32. Unless everyone of you isbuilding semantic/bigdata websites
    33. 33. User >100:First lets separate outour single host intomore than one.• Web• Database– Use RDS to make your lifeeasierWebInstanceElastic IPRDS DBInstanceAmazonRoute 53User
    34. 34. 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
    35. 35. • 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
    36. 36. Scaling this horizontallyand vertically here willget us pretty far( 10s-100s of thousands )
    37. 37. 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
    38. 38. This will take us pretty farhonestly, but we care aboutperformance and efficiency,so lets clean this up a bit
    39. 39. 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
    40. 40. 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
    41. 41. 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.
    42. 42. 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
    43. 43. Now that our Web tier ismuch more light weight, wecan revisit the beginning ofour talk..
    44. 44. Auto-Scaling!
    45. 45. 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
    46. 46. Sunday Monday Tuesday Wednesday Thursday Friday SaturdayTypical weekly traffic to Amazon.com
    47. 47. Sunday Monday Tuesday Wednesday Thursday Friday SaturdayTypical weekly traffic to Amazon.comProvisioned capacity
    48. 48. November traffic to Amazon.comNovember
    49. 49. November traffic to Amazon.comProvisioned capacityNovember
    50. 50. November traffic to Amazon.com76%24%Provisioned capacityNovember
    51. 51. November traffic to Amazon.comNovember
    52. 52. Auto-Scaling let’s you do this!
    53. 53. There’s furtherimprovements to be madein breaking apart ourweb/app layer more
    54. 54. SOA = Service Oriented Architecture
    55. 55. 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
    56. 56. 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
    57. 57. 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
    58. 58. On re-inventing the wheel: ifyou find yourself writingyour own: queue, DNSserver, database, storagesystem, monitoring tool
    59. 59. Take a deep breath and stopit. Now.
    60. 60. Back to SOA
    61. 61. Imagine we let our usersupload photos
    62. 62. S3 BucketFor IngestUserSNS TopicRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributionSQS QueueSize for ThumbnailSQS QueueSize Image forMobileSQS QueueSize Image for WebAuto scalingGroupInstancesAuto scalingGroupInstancesAuto scalingGroupInstances
    63. 63. Amazon Simple Workflow (SWF)• Orchestration tool across your infrastructure• Use it as a middle layer to pass messages and setup tasks to be completed• Break down individual tasks into different workers• You define logic between workers• Anything that can be scripted, can be made into a worker task• Built in retries, timeouts, logging• Low cost, reliability, and scalability built inDeciders WorkersYOUR CODE = &
    64. 64. S3 BucketFor IngestUserSNS TopicRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributionSQS QueueSize for ThumbnailSQS QueueSize Image forMobileSQS QueueSize Image for WebAuto scalingGroupInstancesAuto scalingGroupInstancesAuto scalingGroupInstances
    65. 65. S3 BucketFor IngestUserRRS S3Bucket toServecontent toCloudFrontS3 BucketFororiginalsCloudFrontDownloadDistributionAuto scalingGroupInstancesAuto scalingGroupInstancesAuto scalingGroupInstancesSWFInstance runningdecider
    66. 66. 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
    67. 67. User >1mil+:RDS DB InstanceActive (Multi-AZ)Availability ZoneElastic LoadBalancerRDS DB InstanceRead ReplicaRDS DB InstanceRead ReplicaWebInstanceWebInstanceWebInstanceWebInstanceAmazonRoute 53UserAmazon S3AmazonCloudfrontDynamoDBAmazon SQSElastiCacheWorkerInstanceWorkerInstanceAmazonCloudWatchInternal AppInstanceInternal AppInstanceAmazon SES
    68. 68. The next big steps
    69. 69. 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 )
    70. 70. 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
    71. 71. 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 B002346 C002347 B002349 AABC
    72. 72. 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
    73. 73. HOSTLEVELMETRICSAGGREGATELEVELMETRICSLOGANALYSISEXTERNALSITEPERFORMANCE
    74. 74. Not having propermonitoring/metrics is likeflying a plane with an eye maskon in a thunderstorm. Oh andyour wing is on fire.
    75. 75. 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
    76. 76. 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
    77. 77. AWS Application Management SolutionsElastic Beanstalk OpsWorks CloudFormation EC2Convenience ControlHigher-level Services Do it yourself
    78. 78. 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
    79. 79. A quick review:
    80. 80. • Multi-AZ your infrastructure• Make use of self scaling services ( ELB, S3, DynamoDB, 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
    81. 81. Putting all this togethermeans we should now easilybe able to handle 10+million users!
    82. 82. a few words of caution onwhat not to waste time on…
    83. 83. programming languages
    84. 84. the latest and greatest
    85. 85. copying the tech stack ofany other company
    86. 86. getting too big for yourbritches
    87. 87. To infinity…..
    88. 88. 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.
    89. 89. 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
    90. 90. Next steps?READ! –• aws.amazon.com/documentation• aws.amazon.com/architecture• aws.amazon.com/start-ups
    91. 91. Next steps?START USING AWS –aws.amazon.com/free/
    92. 92. Next steps?ASK FOR HELP!• forums.aws.amazon.com• aws.amazon.com/supportYou’re local account manager!-Will Hanft - williah@amazon.com
    93. 93. THANKS F0R LISTENING!Chris Munns - munns@amazon.comThanks also to First Round, Dorm Room Fund,Gabriel Weinberg, and Technically Philly!!
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×