SlideShare ist ein Scribd-Unternehmen logo
1 von 101
Downloaden Sie, um offline zu lesen
Danilo Poccia
Technical Evangelist
@danilop
danilop
Scaling Up to Your First 10 Million Users
http://i.telegraph.co.uk/multimedia/archive/02674/CLIMBER_2674482b.jpg
Now that’s a lot
of things to read!
This is NOT
where we
want to start!
Auto Scaling
…is a tool and a destination.
It’s not the single thing that
fixes everything.
What do we need first?
Some basics…
Regions
Availability Zones
Edge Locations
ENTERPRISE
APPS
DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS
Data
Warehousing
Hadoop/
Spark
Streaming Data
Collection
Machine
Learning
Elastic
Search
Virtual
Desktops
Sharing &
Collaboration
Corporate
Email
Backup
Queuing &
Notifications
Workflow
Search
Email
Transcoding
One-click App
Deployment
Identity
Sync
Single Integrated
Console
Push
Notifications
DevOps Resource
Management
Application Lifecycle
Management
Containers
Triggers
Resource
Templates
TECHNICAL &
BUSINESS
SUPPORT
Account
Management
Support
Professional
Services
Training &
Certification
Security
& Pricing
Reports
Partner
Ecosystem
Solutions
Architects
MARKETPLACE
Business
Apps
Business
Intelligence Databases
DevOps
Tools NetworkingSecurity Storage
Regions
Availability
Zones
Points of
Presence
INFRASTRUCTURE
CORE SERVICES
Compute
VMs, Auto-scaling,
& Load Balancing
Storage
Object, Blocks,
Archival, Import/Export
Databases
Relational, NoSQL,
Caching, Migration
Networking
VPC, DX, DNSCDN
Access
Control
Identity
Management
Key
Management
& Storage
Monitoring
& Logs
Assessment
and reporting
Resource &
Usage Auditing
SECURITY & COMPLIANCE
Configuration
Compliance
Web application
firewall
HYBRID
ARCHITECTURE
Data Backups
Integrated
App
Deployments
Direct
Connect
Identity
Federation
Integrated
Resource
Management
Integrated
Networking
API
Gateway
IoT
Rules
Engine
Device
Shadows
Device
SDKs
Registry
Device
Gateway
Streaming Data
Analysis
Business
Intelligence
Mobile
Analytics
ENTERPRISE
APPS
DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS
Data
Warehousing
Hadoop/
Spark
Streaming Data
Collection
Machine
Learning
Elastic
Search
Virtual
Desktops
Sharing &
Collaboration
Corporate
Email
Backup
Queuing &
Notifications
Workflow
Search
Email
Transcoding
One-click App
Deployment
Identity
Sync
Single Integrated
Console
Push
Notifications
DevOps Resource
Management
Application Lifecycle
Management
Containers
Triggers
Resource
Templates
TECHNICAL &
BUSINESS
SUPPORT
Account
Management
Support
Professional
Services
Training &
Certification
Security
& Pricing
Reports
Partner
Ecosystem
Solutions
Architects
MARKETPLACE
Business
Apps
Business
Intelligence Databases
DevOps
Tools NetworkingSecurity Storage
Regions
Availability
Zones
Points of
Presence
INFRASTRUCTURE
CORE SERVICES
Compute
VMs, Auto-scaling,
& Load Balancing
Storage
Object, Blocks,
Archival, Import/Export
Databases
Relational, NoSQL,
Caching, Migration
Networking
VPC, DX, DNSCDN
Access
Control
Identity
Management
Key
Management
& Storage
Monitoring
& Logs
Assessment
and reporting
Resource &
Usage Auditing
SECURITY & COMPLIANCE
Configuration
Compliance
Web application
firewall
HYBRID
ARCHITECTURE
Data Backups
Integrated
App
Deployments
Direct
Connect
Identity
Federation
Integrated
Resource
Management
Integrated
Networking
API
Gateway
IoT
Rules
Engine
Device
Shadows
Device
SDKs
Registry
Device
Gateway
Streaming Data
Analysis
Business
Intelligence
Mobile
Analytics
AWS building blocks
Inherently highly available and
fault-tolerant services
Highly available with
the right
architecture
!  Amazon CloudFront
!  Amazon Route 53
!  Amazon S3
!  Amazon DynamoDB
!  Elastic Load Balancing
!  Amazon EFS
!  AWS Lambda
!  Amazon SQS
!  Amazon SNS
!  Amazon SES
!  Amazon SWF
!  …
"  Amazon EC2
"  Amazon EBS
"  Amazon RDS
"  Amazon VPC
So let’s start from…
1 user
You
1 User
•  Amazon Route 53 for DNS
•  A single Elastic IP
•  A single Amazon EC2 instance
•  With full stack on this host
•  Web app
•  Database
•  Management
•  And so on…
Amazon
EC2
instance
Elastic IP
User
Amazon
Route 53
“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
c4.8xlarge
m3.2xlarge
t2.nano
“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
c4.8xlarge
m3.2xlarge
t2.nano
1 User
•  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
User
Amazon
Route 53
1 User
•  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
User
Amazon
Route 53
Users >1
Users > 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
User
Amazon
Route 53
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 Server
Oracle
MySQL
PostgreSQL
MariaDB
Amazon Aurora
BYOL or license
Included
Amazon
Redshift
Massively parallel,
petabyte-scale data
warehouse service
Fast, powerful, and
easy to scale
Database options
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 Server
Oracle
MySQL
PostgreSQL
MariaDB
Amazon Aurora
BYOL or license
Included
Amazon
Redshift
Massively parallel,
petabyte-scale data
warehouse service
Fast, powerful, and
easy to scale
Database options
Amazon Aurora
•  Automatic storage scaling (up to 64 TB)
•  Up to 15 read-replicas
•  Continuous (incremental) backups to
Amazon S3
•  6-way replication across 3 AZs
•  MySQL Compatible
To NoSQL, or not to NoSQL?
Some folks won’t like this,
but…
Start with SQL databases
Why start with SQL?
•  Established and well-worn technology.
•  Lots of existing code, communities, books, and tools.
•  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 doing something SUPER peculiar with the data or you have MASSIVE amounts of it.
…but even then SQL will have a place in your stack.
AH HA! You said
“massive
amounts,” and I
will have massive
amounts!
> 5 TB in year one?
Incredibly data intensive workload?
OK!
You might need NoSQL.
Why else might you need NoSQL?
•  Super low-latency applications
•  Metadata-driven datasets
•  Highly nonrelational data
•  Need schema-less data constructs*
•  Massive amounts of data (again, in the TB range)
•  Rapid ingest of data (thousands of records/sec)
*Need!= “It’s easier to do dev without schemas”
Users >100
Users >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
RDS DB
instance
User
Amazon
Route 53
Users >1000
Users >1000
Next, let’s address our lack of
failover and redundancy issues:
Another web instance
•  In another Availability Zone
RDS Multi-AZ
Elastic Load Balancing (ELB)
Web
Instance
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
Web
Instance
RDS DB Instance
Standby (Multi-AZ)
ELB
Balancer
User
Amazon
Route 53
Elastic Load Balancing
•  Highly available
•  1 - 65535
•  Health checks
•  Session stickiness
•  Secure sockets layer
•  Monitoring
•  Logging
horizontally
vertically
Users > 10,000s–100,000s
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
RDS DB Instance
Standby (Multi-AZ)
ELB
Balancer
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 53User
What about
performance and efficiency?
Lighten the Load
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
Shift some load around
Web Instances
•  static content to Amazon S3
and Amazon CloudFront
Move…
Amazon Simple Storage Service (S3)
•  Object-based storage
•  Highly durable
•  Great for static assets
•  “Infinitely scalable”
•  Objects up to 5 TB in size
•  Optional encryption
Amazon CloudFront
•  Cache content for faster delivery
•  Lower load on origin
•  Dynamic and static content
•  Streaming video
•  Custom SSL certificates
•  Low TTLs (as short as 0 seconds)
•  Optimized for AWS
Amazon CloudFront
Response	
  Time	
  
Server	
  Load	
  
Response	
  
Time	
  
Server	
  
Load	
  
Response	
  
Time	
  
Server	
  
Load	
  
No	
  CDN	
   CDN	
  for	
  Sta6c	
  
Content	
  
CDN	
  for	
  Sta6c	
  &	
  
Dynamic	
  Content	
  
0
50
100
8:00AM
9:00AM
10:00AM
11:00AM
12:00PM
1:00PM
2:00PM
3:00PM
4:00PM
5:00PM
6:00PM
7:00PM
8:00PM
9:00PM
VolumeofData
Delivered(Gbps)
Shift some load around
•  static content to Amazon S3 and
Amazon CloudFront
Move…
•  session/state to Amazon
DynamoDB
•  DB caching to Amazon
ElastiCache RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
ElastiCache DynamoDB
Web Instances
Amazon DynamoDB
•  Managed NoSQL database
•  Provisioned throughput
•  Fast, predictable performance
•  Fully distributed, fault tolerant
•  JSON support
•  Items up to 400 KB
Amazon Elasticache
•  Managed Memcached or Redis
•  Scale from one to many nodes
•  Self-healing (replaces dead instance)
•  Single digit ms speeds (usually)
•  Local to a single AZ for Memcached
•  Multi-AZ possible with Redis
Shift some load around
Move…
•  static content to Amazon S3
and Amazon CloudFront
•  session/state to Amazon
DynamoDB
•  DB caching to Amazon
ElastiCache
•  dynamic content to Amazon
CloudFront
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFrontUser
ElastiCache DynamoDB
Web Instances
Amazon
Route 53
Now that our web tier is
much more lightweight, we
can revisit the beginning
of our talk…
Auto Scaling!
Automatic resizing of compute clusters
Define min/max pool sizes
CloudWatch metrics drive scaling
On-demand or Spot instances
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, us-west-2b
Auto Scaling
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
Sunday Monday Tuesday Wednesday Thursday Friday Saturday
Typical weekly traffic to Amazon.com
Provisioned capacity
November
November traffic to Amazon.com
Provisioned capacity
November
November traffic to Amazon.com
November traffic to Amazon.com
76%
24%
November
Provisioned capacity
November traffic to Amazon.com
November
Auto Scaling
lets you do this!
= one user
= 1,000,000 users
Users >500,000
Users > 500,000+
Availability Zone
Amazon
Route 53
User
Amazon S3
Amazon
CloudFront
Availability Zone
ELB
Balancer
DynamoDB
RDS 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)
Users > 500,000+
Availability Zone
Amazon
Route 53
User
Amazon S3
Amazon
CloudFront
Availability Zone
ELB
Balancer
DynamoDB
RDS 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 automation
AWS application management solutions
Convenience Control
Higher-level services Do it yourself
AWS
Elastic Beanstalk
AWS
OpsWorks
AWS
CloudFormation
Amazon EC2
AWS
CodePipeline
AWS
CodeDeploy
AWS
CodeCommit
<demo>
...
</demo>
Users >500,000+
•  Monitoring, metrics, and logging
•  If you can’t build it internally,
outsource it! (third-party SaaS)
•  What are customers saying?
•  Try to squeeze as much performance
out of each service/component
AGGREGATE
LEVEL
METRICS
LOG
ANALYSIS
EXTERNAL
SITE
PERFORMANCE
HOST
LEVEL
METRICS
There are further
improvements to be made
in breaking apart our
web/app layer
SOA
What does this mean?
Now that’s a lot
of things to read!
This is NOT
where we
want to start!
This is NOT
where we
want to start!
This IS where
we want to start!
Now that’s a lot
of things to read!
SOAing
Move services into their own tiers.
•  Treat them separately and scale
them independently.
Amazon and AWS do this extensively!
It offers flexibility and greater
understanding of each component
Loose coupling + SOA = winning
DON’T REINVENT THE WHEEL
•  Email
•  Queuing
•  Transcoding
•  Search
•  Databases
•  Monitoring
•  Metrics
•  Logging
•  Compute
Amazon
CloudSearch
Amazon SQSAmazon SNS
Amazon Elastic
Transcoder
Amazon SWFAmazon SES
AWS Lambda
•  Reliable (Multi-AZ)
•  Scalable (unlimited messages)
•  Secure (queue authentication)
•  Simple (simple APIs)
Application Services – Amazon SQS
SQS
messages
Get
Message
Instance
Put
Message
Instance
Amazon SNS
 Topic
Publish
Notification
Queue Is Subscribed
to Topic
Compute / Platform – AWS Lambda
•  Functions triggered by events
•  JavaScript, Java, Python
•  Managed
•  Implicit scaling
and availability S3 Bucket
Lambda
Push: Event
Notification
DynamoDB
Pull: DynamoDB
Stream
Kinesis
Pull: 
Kinesis Stream
Loose coupling sets you free!
The looser they're coupled, the bigger they scale
•  Independent components
•  Design everything as a black box
•  Decouple interactions
•  Favor services with built-in redundancy and scalability rather than
building your own
S3 Bucket
Lambda
Push: Event
Notification
DynamoDB
Pull: DynamoDB
Stream
Amazon
Kinesis
Pull: 
DynamoDB Stream
SQS
messages
Get
Message
Instance
Put
Message
Instance
Amazon SNS
 Topic
Publish
Notification
Queue Is Subscribed
to Topic
Users >1,000,000
Users >1 million+
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
Users >1 million+
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
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
DynamoDB
Amazon SQS
ElastiCache
Worker
Instance
Worker
Instance
Amazon
CloudWatch
Internal App
Instance
Internal App
Instance Amazon SES
Lambda
The next big steps
Users >10,000,000
Users >5 million - 10 million
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 dataset up across multiple hosts
•  Moving some functionality to other types of DBs (NoSQL, Graph)
Database federation
•  Split up databases by function/purpose
•  Harder to do cross-function queries
•  Essentially delays sharding/NoSQL
•  Won’t help with single huge functions/tables
Forums DB
Users DB
Products
DB
Sharded horizontal scaling
•  More complex at the application layer
•  No practical limit on scalability
•  Operation complexity/sophistication
•  Shard by function or key space
•  RDBMS or NoSQL
User ShardID
002345 A
002346 B
002347 C
002348 B
002349 A
CBA
Shifting functionality to NoSQL
•  Similar in a sense to federation
•  Again, think about the earlier points for when you
need NoSQL vs. SQL
•  Leverage managed services like DynamoDB
Some use cases:
•  Leaderboards/scoring
•  Rapid ingest of clickstream/log data
•  Temporary data needs (cart data)
•  “Hot” tables
•  Metadata/lookup tablesDynamoDB
A quick review
A quick review
•  Multi-AZ your infrastructure.
•  Make use of self-scaling services—ELB, Amazon S3,
Amazon SNS, Amazon SQS, Amazon SWF, Amazon SES, and
more.
•  Build in redundancy at every level.
•  Start with SQL. Seriously.
•  Cache data both inside and outside your infrastructure.
•  Use automation tools in your infrastructure.
A quick review continued
•  Make sure you have good metrics/monitoring/logging
tools in place
•  Split tiers into individual services (SOA)
•  Use Auto Scaling once you’re ready for it
•  Don’t reinvent the wheel
•  Move to NoSQL if and when it makes sense
Putting all this together
means we should now
easily be able to handle
10+ million users!
To infinity...
User >10 million
Iterating on top of the
patterns seen here will get
you up and over 100 million
users
•  More fine-tuning of your application
•  More SOA of features/functionality
•  Going from Multi-AZ to multi-region
•  Possibly start to build custom solutions
•  Deep analysis of your entire stack
User >10 million
Next steps?
READ!
aws.amazon.com/documentation
aws.amazon.com/architecture
aws.amazon.com/start-ups
START USING AWS:
aws.amazon.com/free/
Money is a
Renewable Resource
Time is Not
<demo>
...
</demo>
Danilo Poccia
Technical Evangelist
@danilop
danilop
Scaling Up to Your First 10 Million Users

Weitere ähnliche Inhalte

Andere mochten auch

Testing Mobile Services on AWS - Pop-up Loft Tel Aviv
Testing Mobile Services on AWS - Pop-up Loft Tel AvivTesting Mobile Services on AWS - Pop-up Loft Tel Aviv
Testing Mobile Services on AWS - Pop-up Loft Tel AvivAmazon Web Services
 
Building Event-driven Serverless Apps
Building Event-driven Serverless AppsBuilding Event-driven Serverless Apps
Building Event-driven Serverless AppsDanilo Poccia
 
Amazon Elastic File System (Amazon EFS)
Amazon Elastic File System (Amazon EFS)Amazon Elastic File System (Amazon EFS)
Amazon Elastic File System (Amazon EFS)Danilo Poccia
 
Improve Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile AppsImprove Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile AppsAmazon Web Services
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDanilo Poccia
 
Masterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIMasterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIDanilo Poccia
 
Programming - Amazon Web Services
Programming - Amazon Web ServicesProgramming - Amazon Web Services
Programming - Amazon Web ServicesAmazon Web Services
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayDanilo Poccia
 
Build Your Mobile App with AWS Mobile Services
Build Your Mobile App with AWS Mobile ServicesBuild Your Mobile App with AWS Mobile Services
Build Your Mobile App with AWS Mobile ServicesAmazon Web Services
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitDanilo Poccia
 
Microservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker ContainersMicroservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker ContainersDanilo Poccia
 
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...Amazon Web Services
 
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDKDeep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDKAmazon Web Services
 
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...Amazon Web Services
 
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersMicroservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersDanilo Poccia
 
Build Mobile Apps using AWS SDKs and AWS Mobile Hub
Build Mobile Apps using AWS SDKs and AWS Mobile HubBuild Mobile Apps using AWS SDKs and AWS Mobile Hub
Build Mobile Apps using AWS SDKs and AWS Mobile HubAmazon Web Services
 
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...Amazon Web Services
 
Mobile Web and App Development with AWS
Mobile Web and App Development with AWSMobile Web and App Development with AWS
Mobile Web and App Development with AWSAmazon Web Services
 

Andere mochten auch (20)

Testing Mobile Services on AWS - Pop-up Loft Tel Aviv
Testing Mobile Services on AWS - Pop-up Loft Tel AvivTesting Mobile Services on AWS - Pop-up Loft Tel Aviv
Testing Mobile Services on AWS - Pop-up Loft Tel Aviv
 
Building Event-driven Serverless Apps
Building Event-driven Serverless AppsBuilding Event-driven Serverless Apps
Building Event-driven Serverless Apps
 
AWS Mobile Hub Overview
AWS Mobile Hub OverviewAWS Mobile Hub Overview
AWS Mobile Hub Overview
 
Amazon Elastic File System (Amazon EFS)
Amazon Elastic File System (Amazon EFS)Amazon Elastic File System (Amazon EFS)
Amazon Elastic File System (Amazon EFS)
 
Improve Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile AppsImprove Monitoring & Monetization of Your Mobile Apps
Improve Monitoring & Monetization of Your Mobile Apps
 
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and ToolsDeployment and Management on AWS:
 A Deep Dive on Options and Tools
Deployment and Management on AWS:
 A Deep Dive on Options and Tools
 
Masterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLIMasterclass Advanced Usage of the AWS CLI
Masterclass Advanced Usage of the AWS CLI
 
Programming - Amazon Web Services
Programming - Amazon Web ServicesProgramming - Amazon Web Services
Programming - Amazon Web Services
 
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API GatewayBuild a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
Build a Server-less Event-driven Backend with AWS Lambda and Amazon API Gateway
 
Build Your Mobile App with AWS Mobile Services
Build Your Mobile App with AWS Mobile ServicesBuild Your Mobile App with AWS Mobile Services
Build Your Mobile App with AWS Mobile Services
 
Amazon Aurora
Amazon AuroraAmazon Aurora
Amazon Aurora
 
Infrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with GitInfrastructure as Code: Manage your Architecture with Git
Infrastructure as Code: Manage your Architecture with Git
 
Microservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker ContainersMicroservices on AWS using AWS Lambda and Docker Containers
Microservices on AWS using AWS Lambda and Docker Containers
 
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
AWS re:Invent 2016: Amazon CloudWatch Logs and AWS Lambda: A Match Made in He...
 
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDKDeep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
Deep-Dive: Building Native iOS and Android Application with the AWS Mobile SDK
 
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
AWS re:Invent 2016: Deep-Dive: Native, Hybrid and Web patterns with Serverles...
 
Microservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker ContainersMicroservice Architecture on AWS using AWS Lambda and Docker Containers
Microservice Architecture on AWS using AWS Lambda and Docker Containers
 
Build Mobile Apps using AWS SDKs and AWS Mobile Hub
Build Mobile Apps using AWS SDKs and AWS Mobile HubBuild Mobile Apps using AWS SDKs and AWS Mobile Hub
Build Mobile Apps using AWS SDKs and AWS Mobile Hub
 
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...
AWS re:Invent 2016: Simplify Cloud Migration with AWS Server Migration Servic...
 
Mobile Web and App Development with AWS
Mobile Web and App Development with AWSMobile Web and App Development with AWS
Mobile Web and App Development with AWS
 

Mehr von Codemotion Dubai

Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...
Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...
Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...Codemotion Dubai
 
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion DubaiSMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion DubaiCodemotion Dubai
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion DubaiCodemotion Dubai
 
Patterns and practices for real-world event-driven microservices by Rachel Re...
Patterns and practices for real-world event-driven microservices by Rachel Re...Patterns and practices for real-world event-driven microservices by Rachel Re...
Patterns and practices for real-world event-driven microservices by Rachel Re...Codemotion Dubai
 
Dockerize it: stop living in the past and embrace the future by Alex Nadalin
 Dockerize it: stop living in the past and embrace the future by Alex Nadalin Dockerize it: stop living in the past and embrace the future by Alex Nadalin
Dockerize it: stop living in the past and embrace the future by Alex NadalinCodemotion Dubai
 
Modelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion DubaiModelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion DubaiCodemotion Dubai
 
Chaos Testing with F# and Azure by Rachel Reese at Codemotion Dubai
Chaos Testing with F# and Azure by Rachel Reese at Codemotion DubaiChaos Testing with F# and Azure by Rachel Reese at Codemotion Dubai
Chaos Testing with F# and Azure by Rachel Reese at Codemotion DubaiCodemotion Dubai
 
Getting Developers hooked on your API by Nicolas Garnier at Codemotion Dubai
Getting Developers hooked on your API by Nicolas Garnier at Codemotion DubaiGetting Developers hooked on your API by Nicolas Garnier at Codemotion Dubai
Getting Developers hooked on your API by Nicolas Garnier at Codemotion DubaiCodemotion Dubai
 
F# in social gaming by Yan Cui at Codemotion Dubai
F# in social gaming by Yan Cui at Codemotion DubaiF# in social gaming by Yan Cui at Codemotion Dubai
F# in social gaming by Yan Cui at Codemotion DubaiCodemotion Dubai
 
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
Building event driven serverless apps by Danilo Poccia at Codemotion DubaiBuilding event driven serverless apps by Danilo Poccia at Codemotion Dubai
Building event driven serverless apps by Danilo Poccia at Codemotion DubaiCodemotion Dubai
 
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...Codemotion Dubai
 
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016Codemotion Dubai
 

Mehr von Codemotion Dubai (12)

Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...
Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...
Embrace chatOps, stop installing deployment software by Geshan Manandhar at C...
 
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion DubaiSMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
SMACK Stack - Fast Data Done Right by Stefan Siprell at Codemotion Dubai
 
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 Microservices for Mortals by Bert Ertman at Codemotion Dubai Microservices for Mortals by Bert Ertman at Codemotion Dubai
Microservices for Mortals by Bert Ertman at Codemotion Dubai
 
Patterns and practices for real-world event-driven microservices by Rachel Re...
Patterns and practices for real-world event-driven microservices by Rachel Re...Patterns and practices for real-world event-driven microservices by Rachel Re...
Patterns and practices for real-world event-driven microservices by Rachel Re...
 
Dockerize it: stop living in the past and embrace the future by Alex Nadalin
 Dockerize it: stop living in the past and embrace the future by Alex Nadalin Dockerize it: stop living in the past and embrace the future by Alex Nadalin
Dockerize it: stop living in the past and embrace the future by Alex Nadalin
 
Modelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion DubaiModelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
Modelling complex game economy with Neo4j by Yan Cui at Codemotion Dubai
 
Chaos Testing with F# and Azure by Rachel Reese at Codemotion Dubai
Chaos Testing with F# and Azure by Rachel Reese at Codemotion DubaiChaos Testing with F# and Azure by Rachel Reese at Codemotion Dubai
Chaos Testing with F# and Azure by Rachel Reese at Codemotion Dubai
 
Getting Developers hooked on your API by Nicolas Garnier at Codemotion Dubai
Getting Developers hooked on your API by Nicolas Garnier at Codemotion DubaiGetting Developers hooked on your API by Nicolas Garnier at Codemotion Dubai
Getting Developers hooked on your API by Nicolas Garnier at Codemotion Dubai
 
F# in social gaming by Yan Cui at Codemotion Dubai
F# in social gaming by Yan Cui at Codemotion DubaiF# in social gaming by Yan Cui at Codemotion Dubai
F# in social gaming by Yan Cui at Codemotion Dubai
 
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
Building event driven serverless apps by Danilo Poccia at Codemotion DubaiBuilding event driven serverless apps by Danilo Poccia at Codemotion Dubai
Building event driven serverless apps by Danilo Poccia at Codemotion Dubai
 
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...
Javascript leverage: Isomorphic Applications by Luciano Colosio at Codemotion...
 
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
Demystifying the 3D Web by Pietro Grandi @ Codemotion Dubai 2016
 

Scaling up to your first 10 million users by Danilo Poccia at Codemotion Dubai

  • 3.
  • 4. Now that’s a lot of things to read! This is NOT where we want to start!
  • 5. Auto Scaling …is a tool and a destination.
  • 6. It’s not the single thing that fixes everything.
  • 7. What do we need first?
  • 12. ENTERPRISE APPS DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS Data Warehousing Hadoop/ Spark Streaming Data Collection Machine Learning Elastic Search Virtual Desktops Sharing & Collaboration Corporate Email Backup Queuing & Notifications Workflow Search Email Transcoding One-click App Deployment Identity Sync Single Integrated Console Push Notifications DevOps Resource Management Application Lifecycle Management Containers Triggers Resource Templates TECHNICAL & BUSINESS SUPPORT Account Management Support Professional Services Training & Certification Security & Pricing Reports Partner Ecosystem Solutions Architects MARKETPLACE Business Apps Business Intelligence Databases DevOps Tools NetworkingSecurity Storage Regions Availability Zones Points of Presence INFRASTRUCTURE CORE SERVICES Compute VMs, Auto-scaling, & Load Balancing Storage Object, Blocks, Archival, Import/Export Databases Relational, NoSQL, Caching, Migration Networking VPC, DX, DNSCDN Access Control Identity Management Key Management & Storage Monitoring & Logs Assessment and reporting Resource & Usage Auditing SECURITY & COMPLIANCE Configuration Compliance Web application firewall HYBRID ARCHITECTURE Data Backups Integrated App Deployments Direct Connect Identity Federation Integrated Resource Management Integrated Networking API Gateway IoT Rules Engine Device Shadows Device SDKs Registry Device Gateway Streaming Data Analysis Business Intelligence Mobile Analytics
  • 13. ENTERPRISE APPS DEVELOPMENT & OPERATIONSMOBILE SERVICESAPP SERVICESANALYTICS Data Warehousing Hadoop/ Spark Streaming Data Collection Machine Learning Elastic Search Virtual Desktops Sharing & Collaboration Corporate Email Backup Queuing & Notifications Workflow Search Email Transcoding One-click App Deployment Identity Sync Single Integrated Console Push Notifications DevOps Resource Management Application Lifecycle Management Containers Triggers Resource Templates TECHNICAL & BUSINESS SUPPORT Account Management Support Professional Services Training & Certification Security & Pricing Reports Partner Ecosystem Solutions Architects MARKETPLACE Business Apps Business Intelligence Databases DevOps Tools NetworkingSecurity Storage Regions Availability Zones Points of Presence INFRASTRUCTURE CORE SERVICES Compute VMs, Auto-scaling, & Load Balancing Storage Object, Blocks, Archival, Import/Export Databases Relational, NoSQL, Caching, Migration Networking VPC, DX, DNSCDN Access Control Identity Management Key Management & Storage Monitoring & Logs Assessment and reporting Resource & Usage Auditing SECURITY & COMPLIANCE Configuration Compliance Web application firewall HYBRID ARCHITECTURE Data Backups Integrated App Deployments Direct Connect Identity Federation Integrated Resource Management Integrated Networking API Gateway IoT Rules Engine Device Shadows Device SDKs Registry Device Gateway Streaming Data Analysis Business Intelligence Mobile Analytics
  • 14. AWS building blocks Inherently highly available and fault-tolerant services Highly available with the right architecture !  Amazon CloudFront !  Amazon Route 53 !  Amazon S3 !  Amazon DynamoDB !  Elastic Load Balancing !  Amazon EFS !  AWS Lambda !  Amazon SQS !  Amazon SNS !  Amazon SES !  Amazon SWF !  … "  Amazon EC2 "  Amazon EBS "  Amazon RDS "  Amazon VPC
  • 15. So let’s start from…
  • 17. 1 User •  Amazon Route 53 for DNS •  A single Elastic IP •  A single Amazon EC2 instance •  With full stack on this host •  Web app •  Database •  Management •  And so on… Amazon EC2 instance Elastic IP User Amazon Route 53
  • 18. “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 c4.8xlarge m3.2xlarge t2.nano
  • 19. “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 c4.8xlarge m3.2xlarge t2.nano
  • 20. 1 User •  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 User Amazon Route 53
  • 21. 1 User •  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 User Amazon Route 53
  • 23. Users > 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 User Amazon Route 53
  • 24. 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 Server Oracle MySQL PostgreSQL MariaDB Amazon Aurora BYOL or license Included Amazon Redshift Massively parallel, petabyte-scale data warehouse service Fast, powerful, and easy to scale Database options
  • 25. 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 Server Oracle MySQL PostgreSQL MariaDB Amazon Aurora BYOL or license Included Amazon Redshift Massively parallel, petabyte-scale data warehouse service Fast, powerful, and easy to scale Database options
  • 26. Amazon Aurora •  Automatic storage scaling (up to 64 TB) •  Up to 15 read-replicas •  Continuous (incremental) backups to Amazon S3 •  6-way replication across 3 AZs •  MySQL Compatible
  • 27. To NoSQL, or not to NoSQL?
  • 28. Some folks won’t like this, but…
  • 29. Start with SQL databases
  • 30. Why start with SQL? •  Established and well-worn technology. •  Lots of existing code, communities, books, and tools. •  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 doing something SUPER peculiar with the data or you have MASSIVE amounts of it. …but even then SQL will have a place in your stack.
  • 31. AH HA! You said “massive amounts,” and I will have massive amounts!
  • 32. > 5 TB in year one? Incredibly data intensive workload? OK! You might need NoSQL.
  • 33. Why else might you need NoSQL? •  Super low-latency applications •  Metadata-driven datasets •  Highly nonrelational data •  Need schema-less data constructs* •  Massive amounts of data (again, in the TB range) •  Rapid ingest of data (thousands of records/sec) *Need!= “It’s easier to do dev without schemas”
  • 35. Users >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 RDS DB instance User Amazon Route 53
  • 37. Users >1000 Next, let’s address our lack of failover and redundancy issues: Another web instance •  In another Availability Zone RDS Multi-AZ Elastic Load Balancing (ELB) Web Instance RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone Web Instance RDS DB Instance Standby (Multi-AZ) ELB Balancer User Amazon Route 53
  • 38. Elastic Load Balancing •  Highly available •  1 - 65535 •  Health checks •  Session stickiness •  Secure sockets layer •  Monitoring •  Logging
  • 40.
  • 41. Users > 10,000s–100,000s RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone RDS DB Instance Standby (Multi-AZ) ELB Balancer 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 53User
  • 44. RDS DB Instance Active (Multi-AZ) Availability Zone ELB Balancer Amazon S3 Amazon CloudFront Amazon Route 53 User Shift some load around Web Instances •  static content to Amazon S3 and Amazon CloudFront Move…
  • 45. Amazon Simple Storage Service (S3) •  Object-based storage •  Highly durable •  Great for static assets •  “Infinitely scalable” •  Objects up to 5 TB in size •  Optional encryption
  • 46. Amazon CloudFront •  Cache content for faster delivery •  Lower load on origin •  Dynamic and static content •  Streaming video •  Custom SSL certificates •  Low TTLs (as short as 0 seconds) •  Optimized for AWS
  • 47. Amazon CloudFront Response  Time   Server  Load   Response   Time   Server   Load   Response   Time   Server   Load   No  CDN   CDN  for  Sta6c   Content   CDN  for  Sta6c  &   Dynamic  Content   0 50 100 8:00AM 9:00AM 10:00AM 11:00AM 12:00PM 1:00PM 2:00PM 3:00PM 4:00PM 5:00PM 6:00PM 7:00PM 8:00PM 9:00PM VolumeofData Delivered(Gbps)
  • 48. Shift some load around •  static content to Amazon S3 and Amazon CloudFront Move… •  session/state to Amazon DynamoDB •  DB caching to Amazon ElastiCache RDS DB Instance Active (Multi-AZ) Availability Zone ELB Balancer Amazon S3 Amazon CloudFront Amazon Route 53 User ElastiCache DynamoDB Web Instances
  • 49. Amazon DynamoDB •  Managed NoSQL database •  Provisioned throughput •  Fast, predictable performance •  Fully distributed, fault tolerant •  JSON support •  Items up to 400 KB
  • 50. Amazon Elasticache •  Managed Memcached or Redis •  Scale from one to many nodes •  Self-healing (replaces dead instance) •  Single digit ms speeds (usually) •  Local to a single AZ for Memcached •  Multi-AZ possible with Redis
  • 51. Shift some load around Move… •  static content to Amazon S3 and Amazon CloudFront •  session/state to Amazon DynamoDB •  DB caching to Amazon ElastiCache •  dynamic content to Amazon CloudFront RDS DB Instance Active (Multi-AZ) Availability Zone ELB Balancer Amazon S3 Amazon CloudFrontUser ElastiCache DynamoDB Web Instances Amazon Route 53
  • 52. Now that our web tier is much more lightweight, we can revisit the beginning of our talk…
  • 54. Automatic resizing of compute clusters Define min/max pool sizes CloudWatch metrics drive scaling On-demand or Spot instances 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, us-west-2b Auto Scaling
  • 55. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to Amazon.com
  • 56. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to Amazon.com Provisioned capacity
  • 59. November traffic to Amazon.com 76% 24% November Provisioned capacity
  • 60. November traffic to Amazon.com November
  • 62. = one user = 1,000,000 users
  • 64. Users > 500,000+ Availability Zone Amazon Route 53 User Amazon S3 Amazon CloudFront Availability Zone ELB Balancer DynamoDB RDS 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)
  • 65. Users > 500,000+ Availability Zone Amazon Route 53 User Amazon S3 Amazon CloudFront Availability Zone ELB Balancer DynamoDB RDS 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)
  • 67. AWS application management solutions Convenience Control Higher-level services Do it yourself AWS Elastic Beanstalk AWS OpsWorks AWS CloudFormation Amazon EC2
  • 70. Users >500,000+ •  Monitoring, metrics, and logging •  If you can’t build it internally, outsource it! (third-party SaaS) •  What are customers saying? •  Try to squeeze as much performance out of each service/component
  • 72. There are further improvements to be made in breaking apart our web/app layer
  • 74.
  • 75. Now that’s a lot of things to read! This is NOT where we want to start!
  • 76. This is NOT where we want to start! This IS where we want to start! Now that’s a lot of things to read!
  • 77. SOAing Move services into their own tiers. •  Treat them separately and scale them independently. Amazon and AWS do this extensively! It offers flexibility and greater understanding of each component
  • 78. Loose coupling + SOA = winning DON’T REINVENT THE WHEEL •  Email •  Queuing •  Transcoding •  Search •  Databases •  Monitoring •  Metrics •  Logging •  Compute Amazon CloudSearch Amazon SQSAmazon SNS Amazon Elastic Transcoder Amazon SWFAmazon SES AWS Lambda
  • 79. •  Reliable (Multi-AZ) •  Scalable (unlimited messages) •  Secure (queue authentication) •  Simple (simple APIs) Application Services – Amazon SQS SQS messages Get Message Instance Put Message Instance Amazon SNS Topic Publish Notification Queue Is Subscribed to Topic
  • 80. Compute / Platform – AWS Lambda •  Functions triggered by events •  JavaScript, Java, Python •  Managed •  Implicit scaling and availability S3 Bucket Lambda Push: Event Notification DynamoDB Pull: DynamoDB Stream Kinesis Pull: Kinesis Stream
  • 81. Loose coupling sets you free! The looser they're coupled, the bigger they scale •  Independent components •  Design everything as a black box •  Decouple interactions •  Favor services with built-in redundancy and scalability rather than building your own S3 Bucket Lambda Push: Event Notification DynamoDB Pull: DynamoDB Stream Amazon Kinesis Pull: DynamoDB Stream SQS messages Get Message Instance Put Message Instance Amazon SNS Topic Publish Notification Queue Is Subscribed to Topic
  • 83. Users >1 million+ 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
  • 84. Users >1 million+ RDS DB Instance Active (Multi-AZ) Availability Zone ELB Balancer 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 DynamoDB Amazon SQS ElastiCache Worker Instance Worker Instance Amazon CloudWatch Internal App Instance Internal App Instance Amazon SES Lambda
  • 85. The next big steps
  • 87. Users >5 million - 10 million 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 dataset up across multiple hosts •  Moving some functionality to other types of DBs (NoSQL, Graph)
  • 88. Database federation •  Split up databases by function/purpose •  Harder to do cross-function queries •  Essentially delays sharding/NoSQL •  Won’t help with single huge functions/tables Forums DB Users DB Products DB
  • 89. Sharded horizontal scaling •  More complex at the application layer •  No practical limit on scalability •  Operation complexity/sophistication •  Shard by function or key space •  RDBMS or NoSQL User ShardID 002345 A 002346 B 002347 C 002348 B 002349 A CBA
  • 90. Shifting functionality to NoSQL •  Similar in a sense to federation •  Again, think about the earlier points for when you need NoSQL vs. SQL •  Leverage managed services like DynamoDB Some use cases: •  Leaderboards/scoring •  Rapid ingest of clickstream/log data •  Temporary data needs (cart data) •  “Hot” tables •  Metadata/lookup tablesDynamoDB
  • 92. A quick review •  Multi-AZ your infrastructure. •  Make use of self-scaling services—ELB, Amazon S3, Amazon SNS, Amazon SQS, Amazon SWF, Amazon SES, and more. •  Build in redundancy at every level. •  Start with SQL. Seriously. •  Cache data both inside and outside your infrastructure. •  Use automation tools in your infrastructure.
  • 93. A quick review continued •  Make sure you have good metrics/monitoring/logging tools in place •  Split tiers into individual services (SOA) •  Use Auto Scaling once you’re ready for it •  Don’t reinvent the wheel •  Move to NoSQL if and when it makes sense
  • 94. Putting all this together means we should now easily be able to handle 10+ million users!
  • 96. User >10 million Iterating on top of the patterns seen here will get you up and over 100 million users
  • 97. •  More fine-tuning of your application •  More SOA of features/functionality •  Going from Multi-AZ to multi-region •  Possibly start to build custom solutions •  Deep analysis of your entire stack User >10 million
  • 99. Money is a Renewable Resource Time is Not