• Save
AWS Summit London 2014 | Scaling on AWS for the First 10 Million Users (200)
Upcoming SlideShare
Loading in...5
×
 

AWS Summit London 2014 | Scaling on AWS for the First 10 Million Users (200)

on

  • 2,176 views

This mid-level technical session will provide an overview of the techniques that you can use to build high-scalabilty applications on AWS. Take a journey from 1 user to 10 million users and understand ...

This mid-level technical session will provide an overview of the techniques that you can use to build high-scalabilty applications on AWS. Take a journey from 1 user to 10 million users and understand how your application's architecture can evolve and which AWS services can help as you increase the number of users that you serve.

Statistics

Views

Total Views
2,176
Views on SlideShare
1,791
Embed Views
385

Actions

Likes
8
Downloads
0
Comments
0

5 Embeds 385

https://twitter.com 321
http://www.thisweekinaws.com 60
http://tweetedtimes.com 2
https://www.linkedin.com 1
https://tweetdeck.twitter.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 Summit London 2014 | Scaling on AWS for the First 10 Million Users (200) AWS Summit London 2014 | Scaling on AWS for the First 10 Million Users (200) Presentation Transcript

  • © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Scaling on AWS for the First 10 Million Users Ian Massingham, Technical Evangelist 30 April 2014@IanMmmm ianmas@amazon.com
  • Scaling to 10M Users: A Story in Four Parts •  Intro and Initial Steps •  Building Blocks •  Tools and Monitoring •  10M Users and Beyond
  • So how do we scale?
  • not where we want to start a lot of things to read
  • Auto Scaling is a tool and a destination. It’s not the single thing that fixes everything.
  • What do we need first?
  • Some basics…
  • •  $7B+ retail business •  8,000+ employees •  A whole lot of servers Every day, AWS adds enough server capacity to power that entire $7B enterprise 2004 2014
  • Support Certification Training Professional Services Technology Partners Consulting Partners AWS Marketplace Ecosystem Elastic Beanstalk for Java, Node.js, Python, Ruby, PHP and .Net OpsWorks CloudFormation Containers & Deployment (PaaS) Management & Administration IAM CloudWatch CloudTrail APIs and SDKs Management Console Cloud HSM Command Line Interface Direct Connect Route 53 VPC Networking Analytics Data Pipeline Redshift EMR Kinesis SWF SNS SQS CloudSearch SES AppStream CloudFront Application Services WorkSpaces Regions Availability Zones Content Delivery POPs Storage Gateway S3 EBS Glacier Import/Export DynamoDB ElastiCache Storage Compute Databases RDS MySQL, PostgreSQL Oracle, SQL Server Elastic Load Balancer EC2 Auto Scaling
  • So let’s start from day one, user one ( you )
  • Day One, User One: •  A single EC2 instance –  With a full stack on this host •  Web app •  Database •  Management •  etc. •  A single Elastic IP address •  Amazon Route 53 for DNS EC2 instance Elastic IP address Amazon Route 53 User
  • “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 eventually m3.xlarge m1.small i2.4xlarge
  • “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 eventually m3.xlarge m1.small i2.4xlarge
  • Day One, User One: •  We could potentially get to a few hundred to a few thousand depending on application complexity and traffic •  No failover •  No redundancy •  Too many eggs in one basket EC2 instance Elastic IP address Amazon Route 53 User
  • Day One, User One: •  We could potentially get to a few hundred to a few thousand depending on application complexity and traffic •  No failover •  No redundancy •  Too many eggs in one basket EC2 instance Elastic IP address Amazon Route 53 User
  • Day Two, User >1: First, let’s separate out our single host into more than one: •  Web •  Database –  Make use of a database service? Web instance Database instance Elastic IP address Amazon Route 53 User
  • Self-Managed Fully-Managed Database server on Amazon EC2 Your choice of database running on Amazon EC2 Bring Your Own License (BYOL) Amazon DynamoDB Managed NoSQL database service using SSD storage Seamless scalability Zero administration Amazon RDS Microsoft SQL, Oracle, MySQL or PostgreSQL as a managed service Flexible licensing BYOL or License Included Amazon Redshift Massively parallel, petabyte-scale, data warehouse service Fast, powerful and easy to scale Database Options
  • Scaling to 10M Users: A Story in Four Parts •  Intro and Initial Steps •  Building Blocks •  Tools and Monitoring •  10M Users and Beyond
  • But how do I choose the DB technology I need? SQL? NoSQL?
  • Start with SQL databases
  • 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 10 million users. No really, you won’t*. •  Clear patterns to scalability * Unless you are manipulating data at MASSIVE scale; even then, SQL will have a place in your stack
  • AH HA! You said “massive amounts”, I will have massive amounts!
  • If your usage is such that you will be generating several TB ( >5 ) of data in the first year OR have an incredibly data-intensive workload… you might need NoSQL
  • Regardless, why NoSQL? •  Super low latency applications •  Metadata driven datasets •  Highly non-relational data •  Need schema-less data constructs* •  Massive amounts of data (again, in the TB range) •  Rapid ingest of data ( thousands of records/sec ) •  Already have skilled staff *Need != “it is easier to do dev without schemas”
  • When NoSQL = Yes… investigate use of DynamoDB
  • Amazon Dynamo DB •  Managed, provisioned throughput NoSQL database •  Fast, predictable performance •  Fully distributed, fault tolerant architecture •  Considerations for non-uniform data Feature Details Provisioned throughput Dial up or down provisioned read/ write capacity Predictable performance Average single digit millisecond latencies from SSD-backed infrastructure Strong consistency Be sure you are reading the most up-to-date values Fault tolerant Data replicated across Availability Zones Monitoring Integrated to Amazon CloudWatch Secure Integrates with AWS Identity and Access Management (AWS IAM) Amazon EMR Integrates with Amazon EMR for complex analytics on large datasets
  • But back to the main path… Let’s see how far SQL at the core can grow
  • User >100: First, let’s separate out our single host into more than one: •  Web •  Database –  Use Amazon RDS to make your life easier Web instance Elastic IP address RDS DB instance Amazon Route 53 User
  • User > 1000: Next, let’s address the lack of failover and redundancy issues: •  Elastic Load Balancing •  Another web instance –  In another Availability Zone •  Enable Amazon RDS Multi-AZ Web instance Amazon RDS DB instance Active (Multi-AZ) Availability Zone Availability Zone Web instance Amazon RDS DB instance Standby (Multi-AZ) Elastic Load Balancing Amazon Route 53 User
  • •  Create highly-scalable applications Feature Details Available Load balance across instances in multiple Availability Zones Health checks Automatically checks health of instances and takes them in or out of service Session stickiness Route requests to the same instance Secure sockets layer Supports SSL offload from web and application servers with flexible cipher support Monitoring Publishes metrics to Amazon CloudWatch Elastic Load Balancing Elastic Load Balancing
  • Scaling this horizontally and vertically will get us pretty far ( 10s-100s of thousands )
  • User >10ks-100ks: RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone RDS DB Instance Standby (Multi-AZ) Elastic Load Balancing RDS DB Instance Read Replica RDS DB Instance Read Replica RDS DB Instance Read Replica RDS DB Instance Read Replica Web instance Web instance Web instance Web instance Web instance Web instance Web instance Web instance Amazon Route 53 User
  • This will take us pretty far, honestly, but we care about performance and efficiency, so let’s clean up with some components and services
  • Shift some load around: Think components and services: •  Move static content from the web instance to Amazon S3 and Amazon CloudFront •  Move session/state and DB caching to Amazon ElastiCache or Amazon DynamoDB •  More on services later… Web instance RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load Balancing Amazon S3 Amazon CloudFront Amazon Route 53 User ElastiCache Amazon DynamoDB
  • Working with Amazon S3 •  Object-based storage for the web •  Designed for 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 permission control •  Ties in well with CloudFront •  Ties in with Amazon EMR •  Acts as a logging endpoint for Amazon S3/CloudFront/Billing •  Supports encryption at transit and at rest •  Reduced redundancy 1/3 cheaper •  Amazon Glacier for super long term storage
  • CloudFront Amazon CloudFront is a web service for scalable content delivery: •  Cache static content at the edge for faster delivery •  Helps lower load on origin infrastructure •  Dynamic and static content •  Streaming video •  Zone apex support •  Custom SSL certificates •  Low TTLs (as short as 0 seconds) •  Lower costs for origin fetches (between Amazon S3 / Amazon EC2 and CloudFront) •  Optimized to work with Amazon EC2, Amazon S3, Elastic Load Balancing, and Amazon Route 53 Response  Time   Server  Load   Response  Time   Server  Load   Response  Time   Server   Load   No  CDN   CDN  for  sta6c   content   CDN  for  sta6c  &   dynamic  content   0   20   40   60   80   8:00   AM   9:00   AM   10:00   AM   11:00   AM   12:00   PM   1:00   PM   2:00   PM   3:00   PM   4:00   PM   5:00   PM   6:00   PM   7:00   PM   8:00   PM   9:00   PM   VolumeofData Delivered(Gbps)
  • Shift some load around: Let’s lighten the load on our web and database instances: •  Move static content from the web instance to Amazon S3 and CloudFront •  Move dynamic content from the load balancer to CloudFront •  Move session/state and DB caching to ElastiCache or Amazon DynamoDB Web instance RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load Balancer Amazon S3 Amazon CloudFront Amazon Route 53 User ElastiCache Amazon DynamoDB
  • Scaling to 10M Users: A Story in Four Parts •  Intro and Initial Steps •  Building Blocks •  Tools and Monitoring •  10M Users and Beyond
  • Now that our web tier is much more lightweight, we can revisit the beginning of our talk…
  • Auto Scaling!
  • Automatic resizing of compute clusters based on demand Trigger auto-scaling policy Feature   Details   Control   Define  minimum  and  maximum  instance  pool   sizes  and  when  scaling  and  cool  down  occurs   Integrated  to  Amazon   CloudWatch   Use  metrics  gathered  by  CloudWatch  to  drive   scaling   Instance  types   Run  Auto  Scaling  for  On-­‐Demand  and  Spot   Instances;  compa6ble  with  VPC   aws  autoscaling  create-­‐auto-­‐scaling-­‐ group   -­‐-­‐auto-­‐scaling-­‐group-­‐name  MyGroup   -­‐-­‐launch-­‐configuration-­‐name  MyConfig   -­‐-­‐min-­‐size  4   -­‐-­‐max-­‐size  200   -­‐-­‐availability-­‐zones  us-­‐west-­‐2c   Auto Scaling Amazon CloudWatch
  • November  traffic  to  Amazon.com   76% 24% Provisioned capacity November
  • Auto Scaling lets you do this!
  • Auto Scaling can help from one instance to thousands and back down
  • User >500k+: Availability Zone Amazon Route 53 User Amazon S3 Amazon CloudFront Availability Zone Elastic Load Balancing Amazon DynamoDBRDS DB Instance Read Replica Web instance Web instance Web instance ElastiCache RDS DB Instance Read Replica Web instance Web instance Web instance ElastiCacheRDS DB Instance Standby (Multi-AZ) RDS DB Instance Active (Multi-AZ)
  • Use Tools: Managing your infrastructure will become an ever increasing important part of your time. Use tools to automate repetitive tasks. •  Tools to manage AWS resources •  Tools to manage software and configuration on your instances •  Automated data analysis of logs and user actions
  • AWS Application Management Solutions AWS Elastic Beanstalk AWS OpsWorks AWS CloudFormation Amazon EC2 Convenience Control Higher-level services Do it yourself
  • Host-Based Configuration Management Two big players: –  Opscode Chef –  PuppetLabs Puppet •  Both do more or less the same thing •  Both have syntax that isn’t too dissimilar •  Use HBCM with one of the tools from the previous slide •  Spend the time required to learn them •  Can’t scale easily without HBCM •  Growing in popularity: Salt, Ansible
  • User >500k+: You’ll potentially start to run into issues with speed and performance of your applications: •  Have monitoring/metrics/logging in place –  If you can’t build it internally, outsource it! (3rd party SaaS) •  Pay attention to what customers are saying works well •  Squeeze as much performance as you can out of each service/component
  • User >1mil+: Reaching a million and above is going to require some bit of all the previous things: •  Multi-AZ •  Elastic Load Balancing between tiers •  Auto Scaling •  Service-oriented architecture •  Serving content smartly (Amazon S3/CloudFront) •  Caching off DB •  Moving state off tiers that auto-scale
  • User >1mil+: RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load Balancing RDS DB Instance Read Replica RDS DB Instance Read Replica Web instance Web instance Web instance Web instance Amazon Route 53 User Amazon S3 Amazon CloudFront Amazon DynamoDB Amazon SQS ElastiCache Worker instance Worker instance Amazon CloudWatch Internal app instance Internal app instance Amazon SES
  • The next big steps
  • User >5mil – 10mil: You’ll potentially start to run into issues with your database around contention on the write master. How can you solve it? •  Federation ~ splitting into multiple DBs based on function •  Sharding ~ splitting one data set up across multiple hosts •  Moving some functionality to other types of DBs (NoSQL)
  • …and there you have it. 10 Million
  • Scaling from 1 to 10 million users Boyan Dimitrov, Senior Systems Engineer at Hailo
  • AWS Summits 2014  
  • AWS Summits 2014
  • AWS Summits 2014 The world’s highest-rated taxi app - over 13,000 five- star reviews To date, Hailo has carried more than 9 million passengers Hailo has over 50,000 registered taxi drivers worldwide
  • November 2011: Hailo 1.0 Launch Users: 1   Regions: eu-west-1   AWS Summits 2014  
  • eu-west-1 Java MYSQL PHP Architecture specifics •  Monolithic PHP and Java applications •  Built and supported by 3-4 backend engineers •  MySQL master-master replication for resilience •  Multi-AZ since day 1 •  City-specific environments   AWS specifics  Route 53 ELB S3 AWS Summits 2014  
  • Challenges •  Hard to develop new features •  Painful to push code changes •  Adding new instances and adding more capacity is a very slow process •  Unreliable and slow failover procedures •  SPOF AWS Summits 2014  
  • December 2013: Hailo 2.0 AWS Summits 2014   Users: 1 000 000+   Regions: eu-west-1, us-east-1, ap-northeast-1  
  • Architecture specifics •  SOA built in Go and Java •  Seamless service discovery, service to service communication, monitoring and instrumentation •  Everything is automated •  Ability to scale services up and down based on demand   AWS specifics  Route 53 ELB S3 AWS Summits 2014   Autoscaling Cloudfront Redshift
  • eu-west-1 Message Bus+ Go Services Proxy Layer Java Services C* us-east-1 Proxy Layer C* ap-northeast -1 Proxy Layer C* AWS Summits 2014   Distributed Queue+ Message Bus+ Distributed Queue+ Message Bus+ Distributed Queue+ Go Services Java Services Go Services Java Services
  • Challenges •  Hard to develop new features Completing new features in days, not months •  Painful to push code changes Seamless service deployment and ability to run multiple versions of a service •  Adding new instances and adding more capacity is slow Our servers scale up and down based on demand •  Unreliable and slow failover procedures Automated reaping of misbehaving services and AZ failover •  SPOF Fault-tolerant distributed services architecture AWS Summits 2014  
  • Important KPI AWS Summits 2014  
  • The Future AWS Summits 2014  
  • AWS Summits 2014  
  • AWS Summits 2014  
  • Tooling AWS Summits 2014  
  • AWS Summits 2014  
  • AWS Summits 2014  
  • AWS Summits 2014  
  • Thank  you,  any  ques6ons?   AWS Summits 2014   boyan@hailocab.com @nathariel  
  • Next Steps? READ! •  aws.amazon.com/documentation •  aws.amazon.com/architecture •  aws.amazon.com/start-ups
  • AWS Partner Trail Win a Kindle Fire •  10 in total •  Get a code from our sponsors
  • Please rate this session using the AWS Summits App and help us build better events
  • #AWSSummit @AWScloud @AWS_UKI
  • © 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc.© 2014 Amazon.com, Inc. and its affiliates. All rights reserved. May not be copied, modified, or distributed in whole or in part without the express consent of Amazon.com, Inc. Scaling on AWS for the First 10 Million Users Thank you! Ian Massingham, Technical Evangelist 30 April 2014 ianmas@amazon.com @IanMmmm