You want to launch your online platform and from a technical perspective you are wondering where to start and how to optimize your architecture?
Cloud Computing presents several advantages such as scaling whenever you want your app our your Website. The hardest part is to define where to begin!
During this 45 minutes workshop, Julien Simon will share with you the best practices to scale your platform from 0 to millions of users. He will present:
- How to combine efficiently the tools Amazon Web Services provides,
- How to set up the best architecture for your platform
- How to scale your infrastructure in the Cloud.
Before joining AWS, Julien worked as CTO of Viadeo and Aldebaran Robotics. He also spent more than 3 years as VP Engineering at Criteo. He is particularly interested by architecture, performance, deployment, scalability and data.
3. Day 1, user 1
• A single Amazon EC2
instance, with full stack on
this host
– Web app
– Database
– Management
– And so on…
• A single Elastic IP address
• Amazon Route 53 for DNS
Amazon
EC2
instance
Elastic IP
address
Amazon
Route 53
User
4. “We’re gonna need a bigger box”
• “Scale up”: 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 a wall eventually
c4.8xlarge
m4.2xlarge
t2.micro
5. Day 1, user 1
• We could potentially get
to a few hundred to a few
thousand depending on
application complexity
and traffic
• No failover
• No redundancy
• Too many eggs in one
basket
EC2
instance
Elastic IP
address
Amazon
Route 53
User
6. Day 2, user > 1
First, let’s separate out
our single host into
more than one
• Web
• Database
– Make use of a database
service?
Web
instance
Database
instance
Elastic IP
address
Amazon
Route 53
User
7. 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
SQL Server, Oracle,
MySQL, MariaDB,
Aurora or
PostgreSQL as a
managed service
Flexible licensing:
BYOL or license
included
Amazon
Redshift
Massively parallel,
petabyte-scale data
warehouse service
Fast, powerful, and
easy to scale
Database options
8. 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
address
RDS DB
instance
Amazon
Route 53
User
9. Users > 1000
Next, let’s address our
lack of failover and
redundancy issues:
• Elastic Load
Balancing (ELB)
• Another web instance
– In another Availability
Zone
• RDS Multi-AZ
Web
Instance
RDS DB Instance
Active (Multi-AZ)
Availability Zone Availability Zone
Web
Instance
RDS DB Instance
Standby (Multi-AZ)
ELB
Balancer
Amazon
Route 53
User
11. 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 53
User
12. This will take us pretty far, but
we care about performance
and efficiency, so let’s
improve further
13. RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon
Route 53
User
Let’s lighten the load on our
web and database instances:
• Move static content from
the web instance to
Amazon S3 and Amazon
CloudFront
• Move session/state and
DB caching to Amazon
ElastiCache or Amazon
DynamoDB
Shift some load around
Web Instances
14. RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
Let’s lighten the load on our
web and database instances:
• Move static content from
the web instance to
Amazon S3 and Amazon
CloudFront
• Move session/state and
DB caching to Amazon
ElastiCache or Amazon
DynamoDB
Shift some load around
Web Instances
15. Shift some load around
Let’s lighten the load on our
web and database instances:
• Move static content from the
web instance to Amazon S3
and Amazon CloudFront
• Move session/state and
DB caching to Amazon
ElastiCache or Amazon
DynamoDB
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
ElastiCache
DynamoDB
Web Instances
16. Shift some load around
Let’s lighten the load on our
web and database instances:
• Move static content from the
web instance to Amazon S3
and Amazon CloudFront
• Move session/state and DB
caching to ElastiCache or
DynamoDB
• Move dynamic content from
the ELB balancer to
Amazon CloudFront
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
ElastiCache
DynamoDB
Web Instances
17. Shift some load around:
Let’s lighten the load on our
web and database instances:
• Move static content from the
web instance to Amazon S3
and Amazon CloudFront
• Move session/state and DB
caching to ElastiCache or
DynamoDB
• Move dynamic content
from the ELB balancer to
Amazon CloudFront
RDS DB Instance
Active (Multi-AZ)
Availability Zone
ELB
Balancer
Amazon S3
Amazon
CloudFront
Amazon
Route 53
User
ElastiCache
DynamoDB
Web Instances
20. 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)
28. Demo: a serverless data pipeline
Lambda
DynamoDB
S3
Kinesis
Firehose
API Gateway
HTTP POST
/prod/logger
writeToDynamoDB dynamodb.
put_item()
Lambda
DynamoDBToFirehose
firehose.
put_record()
S3
eventTable
DynamoDB
streams
bucket
EMR,
Redshift,
…
firehoseToS3
Web apps
29. Demo: a serverless data pipeline
Lambda
DynamoDB
S3
Kinesis
Firehose
API Gateway
HTTP POST
/prod/logger
writeToDynamoDB dynamodb.
put_item()
Lambda
DynamoDBToFirehose
firehose.
put_record()
S3
eventTable
DynamoDB
streams
bucket
EMR,
Redshift,
…
firehoseToS3
Web apps
Lines of code: 16
Number of servers: zero
Performance & scalability: maximum
30. Putting all this together
means we should now
easily be able to handle
10+ million users!
31. Supercell: 100 million active users daily
https://twitter.com/ipaananen/status/706844089216532480
32. Case study: Supercell
45 billion real-time events and 10 TB of data every day
DynamoDBEMR
“We don’t have to worry about being able to manage our infrastructure
to match our growth — AWS tools make it easy for us.”
Sami Yliharju, Services Lead
Kinesis GlacierS3
https://aws.amazon.com/fr/solutions/case-studies/supercell/
33. “AWS is the easy answer for any
Internet business that wants to
scale to the next level”
Nathan Blecharczyk
Co-founder & CTO of Airbnb
https://aws.amazon.com/fr/solutions/case-studies/airbnb/
35. Upcoming book on AWS Lambda
Written by AWS Technical
Evangelist Danilo Poccia
Early release available at:
https://www.manning.com/books/
aws-lambda-in-action