SlideShare uma empresa Scribd logo
1 de 84
Baixar para ler offline
Scaling on AWS for the First 10 Million Users
• ME: Chris Munns – Solutions Architect – Amazon Web
Services – munns@amazon.com
• YOU: Here to learn more about scaling infrastructure
on AWS
• TODAY: about best practices and things to think about
when building for large scale
So how do we scale?
a lot of things to read
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:
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)
Regions
ASIA PAC
(Singapore)
US-WEST (Oregon)
EU-WEST (Ireland)
ASIA PAC (Tokyo)
US-WEST (N. California)
SOUTH AMERICA (Sao Paulo)
US-EAST (Virginia)
AWS GovCloud (US)
ASIA PAC
(Sydney)
Availability Zones
ASIA PAC
(Singapore)
• $5.2B retail business
• 7,800 employees
• A whole lot of servers
Every day, AWS adds enough
server capacity to power that
whole $5B enterprise
Compute Storage
AWS Global Infrastructure
Database
App Services
Deployment & Administration
Networking
Compute Storage
AWS Global Infrastructure
Database
App Services
Deployment & Administration
Networking
Amazon
CloudWatch AWS IAM AWS
CloudFormation
Amazon Elastic
Beanstalk
AWS
Data
Pipeline
AWS
OpsWorks
Amazon
CloudSearch
Amazon SQSAmazon
SNS
Amazon
Elastic
Transcoder
Amazon SWF
Amazon SES
Amazon
DynamoDB
Amazon RDS
Amazon
ElastiCache
Amazon
RedShift
AWS Storage
Gateway
Amazon S3
Amazon
Glacier
Amazon
CloudFrontAmazon
EC2
Amazon
EMR
Amazon
VPC
Amazon
Route 53
AWS
Direct
Connect
So let’s start from day
one, user one ( you ):
Day One, User One:
• A single EC2 Instance
– With full stack on this host
• Web App
• Database
• Management
• etc
• A single Elastic IP
• Route53 for DNS
EC2
Instance
Elastic IP
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
hi1.4xlarge
m2.4xlarge
m1.small
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
Amazon
Route 53
User
Day Two, User >1:
First lets separate out
our single host into
more than one.
• Web
• Database
– Make use of a database
service?
Web
Instance
Database
Instance
Elastic IP
Amazon
Route 53
User
Self-Managed Fully-Managed
Database Server
on Amazon EC2
Your choice of
database running on
Amazon EC2
BringYour Own
License (BYOL)
Amazon
DynamoDB
Managed NoSQL
database service
using SSD storage
Seamless
scalability Zero
administration
Amazon RDS
Microsoft SQL,
Oracle or MySQL 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
But how do I choose
what DB technology I
need? SQL? NoSQL?
Some folks won’t like
this. But…
Start with SQL
databases
But, but, but, but…
No.You don’t.
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 doing something SUPER weird with the data or
MASSIVE amounts of it, 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 work load you might
need NoSQL
But this is probably
less than 90% of you
User >100:
First lets separate out
our single host into
more than one.
• Web
• Database
– Use RDS to make your life
easier
Web
Instance
Elastic IP
RDS DB
Instance
Amazon
Route 53
User
User > 1000:
Next let’s address our
lack of failover and
redundancy issues:
• Elastic Load Balancer
• Another Web instance
– In another Availability Zone
• Enable RDS Multi-AZ
Web
Instance
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
Web
Instance
RDS DB Instance
Standby (Multi-AZ)
Elastic Load
Balancer
Amazon
Route 53
User
• Create highly scalable applications
• Distribute load across EC2 instances
in multiple availability zones
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 CloudWatch
Elastic Load
Balancer
Elastic Load Balancing
Scaling this horizontally
and vertically here 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
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 53
User
This will take us pretty far
honestly, but we care about
performance and efficiency,
so lets clean this up a bit
Shift some load around:
Let’s lighten the load on
our web and database
instances a bit:
• Move static content from
webs to S3 and CloudFront
• Move session/state and DB
caching to ElastiCache or
DynamoDB
Web
Instance
RDS DB Instance
Active (Multi-AZ)
Availability Zone
Elastic Load
Balancer
Amazon S3
Amazon
Cloudfront
Amazon
Route 53
User
ElastiCache
DynamoDB
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 permission
control
• Ties in well with CloudFront
• Ties in with EMR
• Acts as a logging endpoint for
S3/CloudFront/Billing
• Supports Encryption at transit and at
rest
• Reduced Redundancy 1/3 cheaper
• Glacier for super long term storage
DynamoDB
• 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 CloudWatch.
Secure Integrates with AWS Identity
and Access Management (IAM).
Elastic
MapReduce
Integrates with Elastic
MapReduce for complex
analytics on large datasets.
ElastiCache
• Hosted Memcached
– Speaks same API as traditional open source
memcached
• 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 clusters
growing and shrinking without affecting your application
Now that our Web tier is
much more light weight, 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. Compatible with VPC.
as-create-auto-scaling-group MyGroup
--launch-configuration MyConfig
--availability-zones us-east-1a
--min-size 4
--max-size 200
Auto-Scaling
Amazon
CloudWatch
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 traffic to Amazon.com
November
November traffic to Amazon.com
Provisioned capacity
November
November traffic to Amazon.com
76%
24%
Provisioned capacity
November
November traffic to Amazon.com
November
Auto-Scaling lets you do this!
There’s further
improvements to be made
in breaking apart our
web/app layer more
SOA = Service Oriented Architecture
SOA’ing
Move services into their own
tiers/modules.Treat each of
these as 100% whole-y separate
pieces of your infrastructure and
scale them independently.
Amazon.com and AWS do this
extensively! It offers flexibility
and greater understanding of
each component
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 than building your own
Controller A Controller B
Controller A Controller B
Q Q
Tight Coupling
Use Amazon SQS as Buffers
Loose Coupling
Loose coupling + SOA = winning
In the early days, if someone has a service for
it already, opt to use that instead of building it
yourself. DON’T REINVENT THE WHEEL
Examples:
• Email
• Queuing
• Transcoding
• Search
• Databases
• Monitoring
• Metrics
• Logging
Amazon
CloudSearch
Amazon SQSAmazon SNS
Amazon Elastic
Transcoder
Amazon SWF
Amazon SES
On re-inventing the wheel: if
you find yourself writing
your own: queue, DNS
server, database, storage
system, monitoring tool
Take a deep breath and stop
it. Now.
Back to SOA
Imagine we let our users
upload photos
S3 Bucket
For Ingest
User
SNS Topic
RRS S3
Bucket to
Serve
content to
CloudFront
S3 Bucket
For
originals
CloudFront
Download
Distribution
SQS Queue
Size for Thumbnail
SQS Queue
Size Image for
Mobile
SQS Queue
Size Image for Web
Auto scaling
Group
Instances
Auto scaling
Group
Instances
Auto scaling
Group
Instances
User >1mil+:
Reaching a million and above is going to require some bit
of all the previous things:
• Multi-AZ
• Elastic Load Balancer between tiers
• Auto-Scaling
• Service oriented architecture
• Serving content smartly ( S3/CloudFront )
• Caching off DB
• Moving state off tiers that auto-scale
User >1mil+:
RDS DB Instance
Active (Multi-AZ)
Availability Zone
Elastic Load
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
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 )
Database Federation
• Split up Databases by
function/purpose
• Harder to do cross function
queries
• Essentially delaying the need
for something like
sharding/NoSQL until much
further down the line
• Won’t help with single huge
functions/tables
ForumsDB
UsersDB
ProductsDB
Sharded Horizontal Scaling
• More complex at the
application layer
• ORM support can help
• 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
A
B
C
User >5mil – 10mil:
You’ll potentially start to run into issues with speed and
performance of your applications.
• Need to make sure you have
monitoring/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 well
vs what doesn’t
• Really try to work on squeezing as much performance
out of each service/component
HOST
LEVEL
METRICS
AGGREGATE
LEVEL
METRICS
LOG
ANALYSIS
EXTERNAL
SITE
PERFORMANCE
Not having proper
monitoring/metrics is like
flying a plane with an eye mask
on in a thunderstorm. Oh and
your wing is on fire.
AWS Marketplace & Partners can help
• Customer can find, research, buy
software
• Simple pricing, aligns with EC2 usage
model
• Launch in minutes
• Marketplace billing integrated into your
AWS account
• 700+ products across 20+ categories
Learn more at: aws.amazon.com/marketplace
User >5mil – 10mil:
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
Elastic Beanstalk OpsWorks CloudFormation 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 these one of these along side one of the tools
from the previous slide
• Spend the time required to learn them
• Can’t scale easily with out something like this
A quick review:
• Multi-AZ your infrastructure
• Make use of self scaling services ( ELB, S3, SNS, SQS, SWF,
SES, etc )
• Build in redundancy at every level.
• Start SQL. Seriously.
• Move to NoSQL if it really makes sense
• Leverage managed/low touch services
• Split tiers into individual services ( SOA )
• Use Auto-scaling once you’re ready to
• Use automation tools in your infrastructure
• Make sure you have good metrics/monitoring/logging tools
in place
• Don’t reinvent the wheel
Putting all this together
means we should now easily
be able to handle 10+
million users!
To infinity…..
User >10mil:
A lot of what we covered today will
get you potentially into the high 10s of
millions. Iterating on top of the
patterns seen here will get you up and
over 100 million users.
User >10mil:
• More fine tuning of your application
• More SOA of features/functionality
• Going from Multi-AZ to Multi-Region
• Needing to start potentially building
custom solutions
• Deep analysis of your whole stack
Next steps?
READ! –
• aws.amazon.com/documentation
• aws.amazon.com/architecture
• aws.amazon.com/start-ups
Next steps?
START USING AWS –
aws.amazon.com/free/
Next steps?
ASK FOR HELP!
• forums.aws.amazon.com
• aws.amazon.com/support
Your local account manager!
THANKS F0R LISTENING!
Chris Munns - munns@amazon.com

Mais conteúdo relacionado

Destaque

RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012Amazon Web Services
 
Relational Databases Redefined with AWS
Relational Databases Redefined with AWSRelational Databases Redefined with AWS
Relational Databases Redefined with AWSAmazon Web Services
 
AWS Canberra WWPS Summit 2013 - AWS for Web Applications
AWS Canberra WWPS Summit 2013 - AWS for Web ApplicationsAWS Canberra WWPS Summit 2013 - AWS for Web Applications
AWS Canberra WWPS Summit 2013 - AWS for Web ApplicationsAmazon Web Services
 
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012Amazon Web Services
 
AWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAmazon Web Services
 
AWS Summit 2013 | Auckland - Big Data Analytics
AWS Summit 2013 | Auckland - Big Data AnalyticsAWS Summit 2013 | Auckland - Big Data Analytics
AWS Summit 2013 | Auckland - Big Data AnalyticsAmazon Web Services
 
AWS Customer Success Story - DotAndMedia
AWS Customer Success Story - DotAndMediaAWS Customer Success Story - DotAndMedia
AWS Customer Success Story - DotAndMediaAmazon Web Services
 
SEGA’s Digital Strategy with AWS
SEGA’s Digital Strategy with AWSSEGA’s Digital Strategy with AWS
SEGA’s Digital Strategy with AWSAmazon Web Services
 
AWS Enterprise Summit London | National Rail Enquiries Darwin Migration
AWS Enterprise Summit London | National Rail Enquiries Darwin MigrationAWS Enterprise Summit London | National Rail Enquiries Darwin Migration
AWS Enterprise Summit London | National Rail Enquiries Darwin MigrationAmazon Web Services
 
Un backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésUn backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésAmazon Web Services
 
(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility
(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility
(ISM312) SMB Panel—Using The Cloud to Achieve Business AgilityAmazon Web Services
 
Delivering High Performance Content
Delivering High Performance ContentDelivering High Performance Content
Delivering High Performance ContentAmazon Web Services
 
(DEV303) Practical DynamoDB Programming in Java
(DEV303) Practical DynamoDB Programming in Java(DEV303) Practical DynamoDB Programming in Java
(DEV303) Practical DynamoDB Programming in JavaAmazon Web Services
 
Deep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudDeep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudAmazon Web Services
 
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...Amazon Web Services
 
Automating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVaultAutomating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVaultAmazon Web Services
 

Destaque (20)

RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
RMG204 Optimizing Costs with AWS - AWS re: Invent 2012
 
Relational Databases Redefined with AWS
Relational Databases Redefined with AWSRelational Databases Redefined with AWS
Relational Databases Redefined with AWS
 
AWS Canberra WWPS Summit 2013 - AWS for Web Applications
AWS Canberra WWPS Summit 2013 - AWS for Web ApplicationsAWS Canberra WWPS Summit 2013 - AWS for Web Applications
AWS Canberra WWPS Summit 2013 - AWS for Web Applications
 
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012
MBL203 Building a Mobile Application Platform on AWS - AWS re: Invent 2012
 
AWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyteAWS Customer Presentation - ORbyte
AWS Customer Presentation - ORbyte
 
Analytics in the Cloud
Analytics in the CloudAnalytics in the Cloud
Analytics in the Cloud
 
AWS Summit 2013 | Auckland - Big Data Analytics
AWS Summit 2013 | Auckland - Big Data AnalyticsAWS Summit 2013 | Auckland - Big Data Analytics
AWS Summit 2013 | Auckland - Big Data Analytics
 
AWS Customer Success Story - DotAndMedia
AWS Customer Success Story - DotAndMediaAWS Customer Success Story - DotAndMedia
AWS Customer Success Story - DotAndMedia
 
SEGA’s Digital Strategy with AWS
SEGA’s Digital Strategy with AWSSEGA’s Digital Strategy with AWS
SEGA’s Digital Strategy with AWS
 
Beintoo on Amazon Web Services
Beintoo on Amazon Web ServicesBeintoo on Amazon Web Services
Beintoo on Amazon Web Services
 
AWS Enterprise Summit London | National Rail Enquiries Darwin Migration
AWS Enterprise Summit London | National Rail Enquiries Darwin MigrationAWS Enterprise Summit London | National Rail Enquiries Darwin Migration
AWS Enterprise Summit London | National Rail Enquiries Darwin Migration
 
Un backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectésUn backend: pour tous vos objets connectés
Un backend: pour tous vos objets connectés
 
(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility
(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility
(ISM312) SMB Panel—Using The Cloud to Achieve Business Agility
 
Delivering High Performance Content
Delivering High Performance ContentDelivering High Performance Content
Delivering High Performance Content
 
Building mobile apps on aws
Building mobile apps on awsBuilding mobile apps on aws
Building mobile apps on aws
 
Go Global Right Now (Yes Now!)
Go Global Right Now (Yes Now!)Go Global Right Now (Yes Now!)
Go Global Right Now (Yes Now!)
 
(DEV303) Practical DynamoDB Programming in Java
(DEV303) Practical DynamoDB Programming in Java(DEV303) Practical DynamoDB Programming in Java
(DEV303) Practical DynamoDB Programming in Java
 
Deep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private CloudDeep Dive: Amazon Virtual Private Cloud
Deep Dive: Amazon Virtual Private Cloud
 
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...
AWS Summit 2013 | Singapore - Delivering Search for Today's Local, Social, an...
 
Automating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVaultAutomating Backup & Archiving with AWS and CommVault
Automating Backup & Archiving with AWS and CommVault
 

Mais de Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Último

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 

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

  • 1.
  • 2. Scaling on AWS for the First 10 Million Users • ME: Chris Munns – Solutions Architect – Amazon Web Services – munns@amazon.com • YOU: Here to learn more about scaling infrastructure on AWS • TODAY: about best practices and things to think about when building for large scale
  • 3. So how do we scale?
  • 4.
  • 5.
  • 6. a lot of things to read
  • 7. not where we want to start a lot of things to read
  • 8. Auto-Scaling is a tool and a destination. It’s not the single thing that fixes everything.
  • 9. What do we need first?
  • 11. 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) Regions ASIA PAC (Singapore)
  • 12. 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 Zones ASIA PAC (Singapore)
  • 13. • $5.2B retail business • 7,800 employees • A whole lot of servers Every day, AWS adds enough server capacity to power that whole $5B enterprise
  • 14. Compute Storage AWS Global Infrastructure Database App Services Deployment & Administration Networking
  • 15. Compute Storage AWS Global Infrastructure Database App Services Deployment & Administration Networking Amazon CloudWatch AWS IAM AWS CloudFormation Amazon Elastic Beanstalk AWS Data Pipeline AWS OpsWorks Amazon CloudSearch Amazon SQSAmazon SNS Amazon Elastic Transcoder Amazon SWF Amazon SES Amazon DynamoDB Amazon RDS Amazon ElastiCache Amazon RedShift AWS Storage Gateway Amazon S3 Amazon Glacier Amazon CloudFrontAmazon EC2 Amazon EMR Amazon VPC Amazon Route 53 AWS Direct Connect
  • 16. So let’s start from day one, user one ( you ):
  • 17. 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 DNS EC2 Instance Elastic IP Amazon Route 53 User
  • 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 hi1.4xlarge m2.4xlarge m1.small
  • 19. 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 Amazon Route 53 User
  • 20. Day Two, User >1: First lets separate out our single host into more than one. • Web • Database – Make use of a database service? Web Instance Database Instance Elastic IP Amazon Route 53 User
  • 21. Self-Managed Fully-Managed Database Server on Amazon EC2 Your choice of database running on Amazon EC2 BringYour Own License (BYOL) Amazon DynamoDB Managed NoSQL database service using SSD storage Seamless scalability Zero administration Amazon RDS Microsoft SQL, Oracle or MySQL 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
  • 22. But how do I choose what DB technology I need? SQL? NoSQL?
  • 23. Some folks won’t like this. But…
  • 25. But, but, but, but…
  • 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 10 million users. No really, you won’t* • Clear patterns to scalability *Unless you are doing something SUPER weird with the data or MASSIVE amounts of it, even then SQL will have a place in your stack
  • 29. AH HA! You said “massive amounts”, I will have massive amounts!
  • 30. 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 work load you might need NoSQL
  • 31. But this is probably less than 90% of you
  • 32. User >100: First lets separate out our single host into more than one. • Web • Database – Use RDS to make your life easier Web Instance Elastic IP RDS DB Instance Amazon Route 53 User
  • 33. User > 1000: Next let’s address our lack of failover and redundancy issues: • Elastic Load Balancer • Another Web instance – In another Availability Zone • Enable RDS Multi-AZ Web Instance RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone Web Instance RDS DB Instance Standby (Multi-AZ) Elastic Load Balancer Amazon Route 53 User
  • 34. • Create highly scalable applications • Distribute load across EC2 instances in multiple availability zones 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 CloudWatch Elastic Load Balancer Elastic Load Balancing
  • 35. Scaling this horizontally and vertically here will get us pretty far ( 10s-100s of thousands )
  • 36. User >10ks-100ks: RDS DB Instance Active (Multi-AZ) Availability Zone Availability Zone RDS DB Instance Standby (Multi-AZ) Elastic Load 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 53 User
  • 37. This will take us pretty far honestly, but we care about performance and efficiency, so lets clean this up a bit
  • 38. Shift some load around: Let’s lighten the load on our web and database instances a bit: • Move static content from webs to S3 and CloudFront • Move session/state and DB caching to ElastiCache or DynamoDB Web Instance RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load Balancer Amazon S3 Amazon Cloudfront Amazon Route 53 User ElastiCache DynamoDB
  • 39. 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 permission control • Ties in well with CloudFront • Ties in with EMR • Acts as a logging endpoint for S3/CloudFront/Billing • Supports Encryption at transit and at rest • Reduced Redundancy 1/3 cheaper • Glacier for super long term storage
  • 40. DynamoDB • 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 CloudWatch. Secure Integrates with AWS Identity and Access Management (IAM). Elastic MapReduce Integrates with Elastic MapReduce for complex analytics on large datasets.
  • 41. ElastiCache • Hosted Memcached – Speaks same API as traditional open source memcached • 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 clusters growing and shrinking without affecting your application
  • 42. Now that our Web tier is much more light weight, we can revisit the beginning of our talk..
  • 44. 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. Compatible with VPC. as-create-auto-scaling-group MyGroup --launch-configuration MyConfig --availability-zones us-east-1a --min-size 4 --max-size 200 Auto-Scaling Amazon CloudWatch
  • 45. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to Amazon.com
  • 46. Sunday Monday Tuesday Wednesday Thursday Friday Saturday Typical weekly traffic to Amazon.com Provisioned capacity
  • 47. November traffic to Amazon.com November
  • 48. November traffic to Amazon.com Provisioned capacity November
  • 49. November traffic to Amazon.com 76% 24% Provisioned capacity November
  • 50. November traffic to Amazon.com November
  • 52. There’s further improvements to be made in breaking apart our web/app layer more
  • 53. SOA = Service Oriented Architecture
  • 54. SOA’ing Move services into their own tiers/modules.Treat each of these as 100% whole-y separate pieces of your infrastructure and scale them independently. Amazon.com and AWS do this extensively! It offers flexibility and greater understanding of each component
  • 55. 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 than building your own Controller A Controller B Controller A Controller B Q Q Tight Coupling Use Amazon SQS as Buffers Loose Coupling
  • 56. Loose coupling + SOA = winning In the early days, if someone has a service for it already, opt to use that instead of building it yourself. DON’T REINVENT THE WHEEL Examples: • Email • Queuing • Transcoding • Search • Databases • Monitoring • Metrics • Logging Amazon CloudSearch Amazon SQSAmazon SNS Amazon Elastic Transcoder Amazon SWF Amazon SES
  • 57. On re-inventing the wheel: if you find yourself writing your own: queue, DNS server, database, storage system, monitoring tool
  • 58. Take a deep breath and stop it. Now.
  • 60. Imagine we let our users upload photos
  • 61. S3 Bucket For Ingest User SNS Topic RRS S3 Bucket to Serve content to CloudFront S3 Bucket For originals CloudFront Download Distribution SQS Queue Size for Thumbnail SQS Queue Size Image for Mobile SQS Queue Size Image for Web Auto scaling Group Instances Auto scaling Group Instances Auto scaling Group Instances
  • 62. User >1mil+: Reaching a million and above is going to require some bit of 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
  • 63. User >1mil+: RDS DB Instance Active (Multi-AZ) Availability Zone Elastic Load 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
  • 64. The next big steps
  • 65. 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 )
  • 66. Database Federation • Split up Databases by function/purpose • Harder to do cross function queries • Essentially delaying the need for something like sharding/NoSQL until much further down the line • Won’t help with single huge functions/tables ForumsDB UsersDB ProductsDB
  • 67. Sharded Horizontal Scaling • More complex at the application layer • ORM support can help • 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 A B C
  • 68. User >5mil – 10mil: You’ll potentially start to run into issues with speed and performance of your applications. • Need to make sure you have monitoring/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 well vs what doesn’t • Really try to work on squeezing as much performance out of each service/component
  • 70. Not having proper monitoring/metrics is like flying a plane with an eye mask on in a thunderstorm. Oh and your wing is on fire.
  • 71. AWS Marketplace & Partners can help • Customer can find, research, buy software • Simple pricing, aligns with EC2 usage model • Launch in minutes • Marketplace billing integrated into your AWS account • 700+ products across 20+ categories Learn more at: aws.amazon.com/marketplace
  • 72. User >5mil – 10mil: 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
  • 73. AWS Application Management Solutions Elastic Beanstalk OpsWorks CloudFormation EC2 Convenience Control Higher-level Services Do it yourself
  • 74. 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 these one of these along side one of the tools from the previous slide • Spend the time required to learn them • Can’t scale easily with out something like this
  • 76. • Multi-AZ your infrastructure • Make use of self scaling services ( ELB, S3, SNS, SQS, SWF, SES, etc ) • Build in redundancy at every level. • Start SQL. Seriously. • Move to NoSQL if it really makes sense • Leverage managed/low touch services • Split tiers into individual services ( SOA ) • Use Auto-scaling once you’re ready to • Use automation tools in your infrastructure • Make sure you have good metrics/monitoring/logging tools in place • Don’t reinvent the wheel
  • 77. Putting all this together means we should now easily be able to handle 10+ million users!
  • 79. User >10mil: A lot of what we covered today will get you potentially into the high 10s of millions. Iterating on top of the patterns seen here will get you up and over 100 million users.
  • 80. User >10mil: • More fine tuning of your application • More SOA of features/functionality • Going from Multi-AZ to Multi-Region • Needing to start potentially building custom solutions • Deep analysis of your whole stack
  • 81. Next steps? READ! – • aws.amazon.com/documentation • aws.amazon.com/architecture • aws.amazon.com/start-ups
  • 82. Next steps? START USING AWS – aws.amazon.com/free/
  • 83. Next steps? ASK FOR HELP! • forums.aws.amazon.com • aws.amazon.com/support Your local account manager!
  • 84. THANKS F0R LISTENING! Chris Munns - munns@amazon.com