aws summit berlin 2013 - building web scale applications with aws

64
Ryan Shuttleworth, Technical Evangelist Building Web-Scale Applications with AWS

Upload: aws-germany

Post on 20-Aug-2015

496 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: AWS Summit Berlin 2013 - Building web scale applications with AWS

Ryan Shuttleworth, Technical Evangelist

Building Web-Scale Applications with AWS

Page 2: AWS Summit Berlin 2013 - Building web scale applications with AWS

What’s a web scale application?

Three principles to build upon

Layering the cake:Data

Application

Total Jobs Group – their story

What are we going to cover?

Page 3: AWS Summit Berlin 2013 - Building web scale applications with AWS

What do web scale apps have in

common?

Page 4: AWS Summit Berlin 2013 - Building web scale applications with AWS

Actual demand

Predicted demand

Customerdissatisfaction

Waste

Demand

Time

Elastic capacity No need to guess capacity requirements and over-provisionElastic Capacity

Page 5: AWS Summit Berlin 2013 - Building web scale applications with AWS

Elastic capacity

Demand

Time

Elastic capacity No need to guess capacity requirements and over-provisionElastic Capacity

Page 6: AWS Summit Berlin 2013 - Building web scale applications with AWS

Built on a global footprint

9 Regions

25 Availability Zones

Continuous Expansion

Built across regional availability zones

Page 7: AWS Summit Berlin 2013 - Building web scale applications with AWS

Relational Database ServiceDatabase-as-a-Service

No need to install or manage database instances

Scalable and fault tolerant configurations

DynamoDBProvisioned throughput NoSQL database

Fast, predictable performance

Fully distributed, fault tolerant architecture

Use RDS for databases

Use DynamoDB for high performance key-

value DB

Architected using services

Page 8: AWS Summit Berlin 2013 - Building web scale applications with AWS

Amazon SQS

Processing

task/processing

trigger

Processing results

Amazon SQSReliable, highly scalable, queue service

for storing messages as they travel

between instances

Task A

Task B

(Auto-scaling)

Task C

2

3

1

Simple WorkflowReliably coordinate processing steps

across applications

Integrate AWS and non-AWS resources

Manage distributed state in complex

systems

Push inter-process workflows into the cloud with SWF

Reliable message queuing without

additional software

Architected using services

Page 9: AWS Summit Berlin 2013 - Building web scale applications with AWS

Cloud SearchElastic search engine based upon

Amazon A9 search engine

Fully managed service with

sophisticated feature set

Scales automatically

DocumentServer

Results

SearchServer

Don’t install search software, use CloudSearch

Process large volumes of data cost effectively

with EMR

Elastic MapReduceElastic Hadoop cluster

Integrates with S3 & DynamoDB

Leverage Hive & Pig analytics scripts

Integrates with instance types such as

spot

Architected using services

Page 10: AWS Summit Berlin 2013 - Building web scale applications with AWS

Three principles to build upon…

Page 11: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

1

Page 12: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Elasticity

1

Page 13: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Elasticity

State Data

1

Page 14: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Security

Elasticity

State Data

2

Page 15: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Security

Elasticity

State Data

Inherent2

Page 16: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Security

Elasticity

State Data

Inherent

VPC

Groups

2

Page 17: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

FailureSecurity

Elasticity

State Data

Inherent

VPC

Groups

3

Page 18: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

FailureSecurity

Elasticity

State Data

Inherent

VPC

Expected

Groups

3

Page 19: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

FailureSecurity

Elasticity

State Data

Inherent

VPC

Expected

Automation

TestingGroups

3

Page 20: AWS Summit Berlin 2013 - Building web scale applications with AWS

Scale

Failure

Elasticity

State Data

Expected

Automation

Testing

SecurityInherent

VPC

Groups

Page 21: AWS Summit Berlin 2013 - Building web scale applications with AWS

Layering the cake

Page 22: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Web scale data

Object storage

Page 23: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

You put it in S3AWS stores with 99.999999999% durability

Highly scalable web access to objects

Multiple redundant copies in a region

Page 24: AWS Summit Berlin 2013 - Building web scale applications with AWS

What is S3?

Highly scalable data storage

Access via APIsA web store,

not a file system

Fast

Highly available & durable

Economical

Data

Page 25: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Case S

tudy

Page 26: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Web scale data

Object storage

Page 27: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Web scale data

Object storageRelational data

Page 28: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Master/Slave Horizontal ScalingReasonably simple to implement

Leverage PIOPs for raw performance

Easy to change instances sizes

Has an upper limit

Page 29: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

hash ring

Sharded Horizontal ScalingMore complex at the application layer

No practical limit on scalabilityOperation complexity/sophistication

Shard by function or key spaceRDBMS or NoSQL

A

BC

D

Page 30: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Web scale data

Object storageRelational data

Page 31: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Web scale data

Object storageRelational data

NoSQL

Page 32: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Horizontal Scaling - Fully Managed

DynamoDBProvisioned throughput NoSQL database

Fast, predictable performance

Fully distributed, fault tolerant architecture

Considerations for non-uniform data

Page 33: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

DynamoDBProvisioned read/write performance per table

Predictable high performance scaled via console or

API

Dial it up

Page 34: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Low provisioned throughput

TablePartition

SSD

Region

Illustrative diagram only

Page 35: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Illustrative diagram only

Region

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

TablePartition

SSD

Increased provisioned throughput

Page 36: AWS Summit Berlin 2013 - Building web scale applications with AWS

DataRegion

Illustrative diagram only

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

TablePartition

High provisioned throughput

Page 37: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Loose coupling sets you free!

The looser they're coupled, the bigger they scale

Independent components

Design everything as a black box

Decouple interactions

Load-balance clusters

Page 38: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Amazon SQS

Processing

task/processing trigger

Processing results

Amazon SQSReliable, highly scalable, queue service for storing

messages as they travel between instances

Page 39: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Controller A Controller B Controller C

Tight Coupling

Page 40: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Controller A Controller B Controller C

Controller A Controller B Controller C

Tight Coupling

Loose Coupling

Q Q Q

Page 41: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Auto ScalingAutomatic 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.

Page 42: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Where does state

reside?

Page 43: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Where does state

reside?

Browser cookies

Framework session handler

Session database

Memory session

manager

Page 44: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

State store should be:

Performant

Scalable

Reliable

Page 45: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Trigger auto-scaling policy

Where should state reside?

Page 46: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Trigger auto-scaling policy

Where should state reside?

Not here

Page 47: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Trigger auto-scaling policy

Where should state reside?

Not here

Session state service

State must reside OUTSIDE the scope of the elements you wish to scale

Page 48: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Where should state reside?PerformantScalableReliable

Page 49: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

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 BalancingCreate highly scalable applications

Distribute load across EC2 instances

in multiple availability zones

Page 50: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Route53

Region A

Route53

Region B

Request

Route53Global DNS service

Page 51: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Route53

Region A

Route53

Region B

16ms 92ms

Request

Route53Global DNS service

Page 52: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Route53

Region A

Route53

Region B

16ms 92ms

Request

Route53Global DNS service

Page 53: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Route53

Region A

Route53

Region B

16ms 92ms

RequestRegion A DNS entry

Route53Global DNS service

Page 54: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

London

Paris

NY

Served from S3/images/*

3

Served from EC2*.php

2

Single CNAMEwww.mysite.com

1

CloudFrontWorld-wide content distribution

network

Page 55: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Re

spo

nse

Tim

e

Se

rve

r L

oa

d

Re

spo

nse

Tim

e

Se

rve

r L

oa

d

Re

spo

nse

Tim

e

Ser

ver

Load

No CDN CDN for

Static

Content

CDN for

Static &

Dynamic

Content

CloudFrontWorld-wide content distribution

network

Page 56: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Management

Page 57: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Management

10 instancesmanageable

Page 58: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Management

100 instancesat a push

Page 59: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Management

1,000 instancesnot a chance

Page 60: AWS Summit Berlin 2013 - Building web scale applications with AWS

Data

Application

Load Balancing

Distribution

Management

Automation & management

Web scale enabler

Page 61: AWS Summit Berlin 2013 - Building web scale applications with AWS

OpsWorks Elastic Beanstalk

CloudFormation EC2

Data

Application

Load Balancing

Distribution

Management

Page 62: AWS Summit Berlin 2013 - Building web scale applications with AWS

OpsWorks Elastic Beanstalk

CloudFormation EC2control

convenience

Data

Application

Load Balancing

Distribution

Management

Page 63: AWS Summit Berlin 2013 - Building web scale applications with AWS

Summary

Use these techniques (and many others) as appropriate

Awareness of the options is the first step to good design

Scaling is the ability to move the bottlenecks around to the least expensive part of the architecture

AWS makes this easier – so your application is not a victim of its own success

Summary

Page 64: AWS Summit Berlin 2013 - Building web scale applications with AWS

Thank you