scale, baby, scale!

38
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved Scale, baby, scale! Julien Simon Principal Technical Evangelist Amazon Web Services [email protected] @julsimon

Upload: julien-simon

Post on 12-Apr-2017

740 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Scale, baby, scale!

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

Scale, baby, scale!

Julien Simon Principal Technical Evangelist Amazon Web Services [email protected] @julsimon

Page 2: Scale, baby, scale!

Agenda

•  The old way

•  The new way

•  Demo

Page 3: Scale, baby, scale!

So let’s start from day 1, user 1 (you)

Page 4: Scale, baby, scale!

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

Page 5: Scale, baby, scale!

“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

Page 6: Scale, baby, scale!

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

Page 7: Scale, baby, scale!

100 users 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

Page 8: Scale, baby, scale!

1000 users 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

Page 9: Scale, baby, scale!

Scaling this horizontally and vertically will get us pretty far

(tens to hundreds of thousands)

Page 10: Scale, baby, scale!

10k-100k users

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

Page 11: Scale, baby, scale!

This will take us pretty far, but we care about performance

and efficiency, so let’s improve further

Page 12: Scale, baby, scale!

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

Shift some load around

Web Instances

Page 13: Scale, baby, scale!

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

Shift some load around

Web Instances

Page 14: Scale, baby, scale!

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

Page 15: Scale, baby, scale!

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

Page 16: Scale, baby, scale!

Now that our web tier is much more lightweight…

Page 17: Scale, baby, scale!

Auto Scaling! Resize server farms automatically

based on monitoring metrics

Spot instances! Bid on unused EC2 capacity (typically at 80% discount)

Page 18: Scale, baby, scale!

500k users

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

ElastiCache RDS DB Instance Standby (Multi-AZ)

RDS DB Instance Active (Multi-AZ)

Page 19: Scale, baby, scale!

There are more improvements to be made

and we could get much higher, but do we really

want to manage all these instances ?

Page 20: Scale, baby, scale!

Werner Vogels, CTO, Amazon.com AWS re:Invent 2015

Page 21: Scale, baby, scale!

Use the Force, Luke!

Managed services + AWS Lambda

= Serverless architecture

Page 22: Scale, baby, scale!

Many of our customers have figured it out.

This is what they’re

building!

Page 23: Scale, baby, scale!

Case study : Localytics

Web and mobile app analytics 100 billion data points monthly

https://aws.amazon.com/fr/solutions/case-studies/localytics/

Page 24: Scale, baby, scale!

Case study: Nordstrom https://www.youtube.com/watch?v=TXmkj2a0fRE

Page 25: Scale, baby, scale!

Case study: AdRoll https://www.youtube.com/watch?v=JFfvD2cw2IE https://aws.amazon.com/fr/dynamodb/adtech/ 60 billion Real-Time Bidding events daily

Page 26: Scale, baby, scale!

Demo: a serverless data pipeline

Lambda

DynamoDB

Kinesis Firehose

API Gateway

HTTP POST /prod/logger writeTo

Kinesis

DynamoDBToFirehose

S3

eventTable

DynamoDB streams

bucket

EMR, Redshift,

… firehoseToS3

Kinesis Streams Lambda Lambda

KinesisToDynamoDB

Web apps

Page 27: Scale, baby, scale!

Demo: a serverless data pipeline

Lambda

DynamoDB

Kinesis Firehose

API Gateway

HTTP POST /prod/logger writeTo

Kinesis

DynamoDBToFirehose

S3

eventTable

DynamoDB streams

bucket

EMR, Redshift,

… firehoseToS3

Kinesis Streams Lambda Lambda

KinesisToDynamoDB

Web apps

Lines of code: 16 Number of servers: zero Performance & scalability: maximum

Page 28: Scale, baby, scale!

Putting all this together means we should now

easily be able to handle 10+ million users!

Page 29: Scale, baby, scale!

Are you ready for catastrophic success?

The Barbarians are

at your gates!

Page 30: Scale, baby, scale!

Putting all this together means we should now

easily be able to handle 100+ million users!

Page 31: Scale, baby, scale!

Supercell: 100 million active users daily

https://twitter.com/ipaananen/status/706844089216532480

Page 32: Scale, baby, scale!

Case study: Supercell

45 billion real-time events and 10 TB of data every day

DynamoDB EMR

“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 Glacier S3

https://aws.amazon.com/fr/solutions/case-studies/supercell/

Page 33: Scale, baby, scale!

“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/

Page 34: Scale, baby, scale!

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

And now it’s your turn! What will you build?

Page 35: Scale, baby, scale!

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

Page 36: Scale, baby, scale!

April 25

May 31st

June 28 September 27 December 6

Next events

Page 37: Scale, baby, scale!

AWS User Groups AWS

Lille Paris Rennes Nantes Bordeaux Lyon Montpellier

facebook.com/groups/AWSFrance/

@aws_actus

Page 38: Scale, baby, scale!

©2015,  Amazon  Web  Services,  Inc.  or  its  affiliates.  All  rights  reserved

Thank You !

Julien Simon [email protected]

@julsimon