scaling on aws for the first 10 million users at websummit dublin

31
Scaling on AWS for the First 10 Million Users [email protected] @IanMmmm Ian Massingham — Technical Evangelist WEB SUMMIT DUBLIN 2014 #AWS #WEBSUMMIT STARTING AT 11:00

Upload: amazon-web-services

Post on 01-Jul-2015

148 views

Category:

Technology


2 download

DESCRIPTION

In this talk from the Dublin Websummit 2014 AWS Technical Evangelist Ian Massingham discusses the techniques that AWS customers can use to create highly scalable infrastructure to support the operation of large scale applications on the AWS cloud. Includes a walk-through of how you can evolve your architecture as your application becomes more popular and you need to scale up your infrastructure to support increased demand.

TRANSCRIPT

Page 1: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Scaling on AWS for the First 10 Million Users

[email protected]

@IanMmmm

Ian Massingham — Technical Evangelist

WEB S

UM

MIT

DUBLIN

201

4

#AW

S #W

EBSUM

MIT

STARTING AT 11:00

Page 2: Scaling on AWS for the First 10 Million Users at Websummit Dublin

An Introduction to Scaling on AWS

Page 3: Scaling on AWS for the First 10 Million Users at Websummit Dublin

An awful lot of things to read

Not where we want to start

EC2 Auto Scaling is one tool, not the single thing that ‘fixes’

everything or enables you to scale

Page 4: Scaling on AWS for the First 10 Million Users at Websummit Dublin

SO WHAT DO WE NEED FIRST?

Page 5: Scaling on AWS for the First 10 Million Users at Websummit Dublin

SOME BASICS

Page 6: Scaling on AWS for the First 10 Million Users at Websummit Dublin

2004 2014$7B+ retail business

8,000+ employees

A whole lot of servers

Every day, AWS adds

enough server

capacity to power that

entire $7B enterprise

Page 7: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Infrastructure

Foundation Services

Regions Availability Zones

Storage(Object, Block and Archive) NetworkingSecurity &

Access Control

Platform Services

Databases

Relational

NoSQL

Caching

Analytics

Hadoop

Real-time

Data warehouse

App Services

Queuing

Orchestration

App streaming

Transcoding

Email

Search

Deployment & Management

Containers

Dev/ops Tools

Resource Templates

Mobile Services

Identity

Sync

Mobile Analytics

Notifications

Enterprise Applications Virtual Desktops

Data Workflows

Usage Tracking

Monitoring and Logs

Compute(VMs, Auto-scaling and Load Balancing)

CDN and Points of Presence

Collaboration and Sharing

Page 8: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Startups on AWS

http://aws.amazon.com/solutions/case-studies/

Page 9: Scaling on AWS for the First 10 Million Users at Websummit Dublin

• A single EC2 instance• With a full stack on this host

• Web app

• Database

• Management

• A single Elastic IP address• Amazon Route 53 for DNS

EC2 instance

Elastic IP address

Amazon Route 53

User

DAY ONE, USER ONE. PROBABLY YOU!

Page 10: Scaling on AWS for the First 10 Million Users at Websummit Dublin

• Simplest approach to scaling

• You 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

WE’RE GOING TO NEED A BIGGER BOX!

Page 11: Scaling on AWS for the First 10 Million Users at Websummit Dublin

• 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

WE’RE GOING TO NEED A BIGGER BOX!

Page 12: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Web instance

Database instance

Elastic IP address

Amazon Route 53

User

• Separate out the functions on our single host onto more than one:

• Web• Database

• Make use of a database service

DAY TWO, USER >1

Page 13: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Self-Managed Fully-Managed

Microsoft SQL, Oracle, MySQL or PostgresSQL

managed service

Flexible licensing: BYOL or Included

Massively parallel, petabyte scale, data warehouse service

Fast, powerful & easy to scale

Managed NoSQL database service using SSD storage

Seamless scalability & zero administration

Database server on Amazon EC2

Amazon RDS Amazon DynamoDB Amazon Redshift

Your chosen database running on Amazon EC2

Database Options

Page 14: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Building Blocks for Scaling on AWS

Page 15: Scaling on AWS for the First 10 Million Users at Websummit Dublin

HOW DO I DETERMINE WHICH DB TECHNOLOGY I NEED?

Page 16: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Why start with SQL?

• Established and well-worn technology• Lots of existing code, communities, books & 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 manipulating data at MASSIVE scale; even then, SQL will have a place in your stack

Page 17: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Why might you need to use a NoSQL DB?

• Super low latency applications• Metadata driven datasets• Highly non-relational data• Need schema-less data constructs*• Massive amounts of data (again, in the TB range)• Rapid ingest of data ( thousands of records/sec )

*Need != “it is easier to do dev without schemas”

Page 18: Scaling on AWS for the First 10 Million Users at Websummit Dublin

• Managed, provisioned throughput NoSQL database• Fast, predictable performance• Fully distributed, fault tolerant architecture

IF YOU DO NEED NOSQL, CONSIDER AMAZON DYNAMODB

Page 19: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Web instance

Elastic IP address

RDS DB instance

Amazon Route 53

User

• First, let’s separate out our single host into more than one:

• Web

• Database

• Use Amazon RDS to make your life easier

USER >100

Page 20: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Web instance

Amazon RDS DB instance Active (Multi-AZ) Availability Zone Availability Zone

Web instance

Amazon RDS DB instance Standby (Multi-AZ)

Elastic Load Balancing

Amazon Route 53

User

• Next, let’s address the lack of failover and redundancy issues:

• Elastic Load Balancing

• Another web instance• In another Availability Zone

• Enable Amazon RDS Multi-AZ

USER >1000

Page 21: Scaling on AWS for the First 10 Million Users at Websummit Dublin

USER 10,000 to 100,000s

RDS DB Instance Active (Multi-AZ)

Availability Zone Availability Zone

RDS DB Instance Standby (Multi-AZ)

Elastic Load Balancing

RDS DB Instance Read Replica

RDS DB Instance Read Replica

RDS DB Instance Read Replica

RDS DB Instance Read Replica

Web instance

Web instance

Web instance

Web instance

Web instance

Web instance

Web instance

Web instance

Amazon Route 53

User

Page 22: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Web instance

RDS DB Instance Active (Multi-AZ) Availability Zone

Elastic Load Balancing

Amazon S3

Amazon CloudFront

Amazon Route 53

User

ElastiCache

Amazon Dynamo DB

• Think components and services:• Move static content from the

web instance to Amazon S3

and Amazon CloudFront

• Move session/state and DB

caching to Amazon ElastiCache

or Amazon Dynamo DB

Shift Some Load Around

Page 23: Scaling on AWS for the First 10 Million Users at Websummit Dublin

NOW THAT OUR WEB TIER IS MUCH MORE LIGHTWEIGHT:

AUTOSCALING!

Page 24: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Automatic resizing of compute clusters based on demand metrics

AMAZON EC2 AUTO SCALING

Trigger auto-scaling policy

Amazon CloudWatch

Feature Details

Control Define minimum and maximum instance pool sizes and when scaling and cool down occurs

Integration Use metrics gathered by CloudWatch to drive scaling (including custom metrics)

Instance Types Use Auto Scaling with On-Demand and Spot Instances

Page 25: Scaling on AWS for the First 10 Million Users at Websummit Dublin

NOVEMBER TRAFFIC TO AMAZON.COM

24% of traditionally provisioned capacity

76% of traditionally provisioned capacity

AUTO SCALING LETS YOU DO THIS

Traditional provisioning level

Page 26: Scaling on AWS for the First 10 Million Users at Websummit Dublin

Availability Zone

Amazon Route 53

User

Amazon S3

Amazon CloudFront

Availability Zone

Elastic Load Balancing

Amazon 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)

USER 500,000+

Page 27: Scaling on AWS for the First 10 Million Users at Websummit Dublin

GOING BEYOND 500,000 USERS

Page 28: Scaling on AWS for the First 10 Million Users at Websummit Dublin

GOING BEYOND 500,000 USERS

• Monitoring, metrics and logging • Listen and respond to customer feedback as well as your metrics• Optimise each service/component• Implement a Service Orientated Architecture with loose coupling• Load balance between tiers

Page 29: Scaling on AWS for the First 10 Million Users at Websummit Dublin

RDS DB Instance Active (Multi-AZ)

Availability Zone

Elastic Load Balancing

RDS DB Instance Read Replica

RDS DB Instance Read Replica

Web instance

Web instance

Web instance

Web instance

Amazon Route 53

User

Amazon S3

Amazon CloudFront

Amazon DynamoDB

Amazon SQS

ElastiCache

Worker instance

Worker instance

Amazon CloudWatch

Internal app instance

Internal app instance

Amazon SES

USER 1 MILLION+

Page 30: Scaling on AWS for the First 10 Million Users at Websummit Dublin

WANT TO LEARN MORE?

COME TO OUR ARCHITECTURE ASK US ANYTHING

TODAY AT 16:00

Page 31: Scaling on AWS for the First 10 Million Users at Websummit Dublin

@IanMmmm

Ian Massingham — Technical Evangelist

@AWScloudAWS Global News and Service Launches

@AWS_UKIAWS UK & Ireland News, Events & Webinars

WEB S

UM

MIT

DUBLIN

201

4

#AW

S #W

EBSUM

MIT

DO

N’T

FO

RGET Y

OUR C

RED

ITS