Journey Through the Cloud - Scalable Web Apps

63
Journey Through the Cloud [email protected] @IanMmmm Ian Massingham — Technical Evangelist Scalable Web Apps

Transcript of Journey Through the Cloud - Scalable Web Apps

Page 1: Journey Through the Cloud - Scalable Web Apps

Journey Through the Cloud

[email protected]@IanMmmm

Ian Massingham — Technical Evangelist

Scalable Web Apps

Page 2: Journey Through the Cloud - Scalable Web Apps

Journey Through the Cloud

Learn from the journeys taken by other AWS customers

Discover best practices that you can use to bootstrap your projects

Common use cases and adoption models for the AWS Cloud123

Page 3: Journey Through the Cloud - Scalable Web Apps

Scalable Web Apps

A very popular use-case for AWS servicesApplications with growing, variable or cyclical demand fit AWS well

Elasticity and automation can be exercised to real advantageAWS services allow you to accelerate application development

Page 4: Journey Through the Cloud - Scalable Web Apps

Agenda

Why use AWS for scalable web applications?Rule Book for scalable web application on AWS

Common patterns for web applicationsWhere to go to learn more

Page 5: Journey Through the Cloud - Scalable Web Apps

WHY AWS FOR SCALABLEWEB APPLICATIONS?

Page 6: Journey Through the Cloud - Scalable Web Apps

Websites & Digital Transformation

Page 7: Journey Through the Cloud - Scalable Web Apps

BEING IN THE CLOUD GIVES US THE SCALABILITY OF ADDING APPLICATION AND DATABASE SERVERS AS WE NEED THEM.

Keith  Mitchell  Programmer  reddit.com

• reddit is a San Francisco, CA company that provides reddit.com, a social news and entertainment website where users can submit and rank ideas, images, and links

• reddit originally operated reddit.com on physical servers, but after the number of users quadrupled in 18 months, the company realized it couldn’t scale with an on-premises environment

• By migrating to AWS, reddit can scale to manage 4 billion page views per month and run its website with only 20 employees

With AWS, reddit scales its social news site to handle 4 billion page views per month with only 20 employees

Find out more here : aws.amazon.com/solutions/case-studies/reddit/

Page 8: Journey Through the Cloud - Scalable Web Apps

Pick your platform

Use your favourite tools

Grow & shrink capacity to match demand

Spend your money on what matters

Take your app or site global in minutes

Never make your customers wait

123456

Page 9: Journey Through the Cloud - Scalable Web Apps

RULE BOOK FOR SCALABLE WEBAPPLICATIONS ON AWS

Page 10: Journey Through the Cloud - Scalable Web Apps

Service all requests

Service requests as fast as possible

Handle requests at any volume

Simply your architecture

Automate operations & management

Use the unique properties of the cloud

123456

Page 11: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATA

Page 12: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATAREQUEST

Page 13: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATAREQUEST

Page 14: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATAREQUEST ╳

Page 15: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATAREQUEST

100%Availability

SLAaws.amazon.com/route53/sla

Global Delivered from AWS global edge locations for fast and reliable domain name resolution

Scalable Automatically scales based upon query volumes

Latency based routing

Supports resolution of endpoints based upon latency, enabling multi-region application delivery

Integrated Integrates with other AWS services allowing Route 53 to front elastic load balancers, S3 and EC2

Secure Integrates with IAM giving fine grained control over DNS record access

Page 16: Journey Through the Cloud - Scalable Web Apps

Service all requests1

DNS APPLICATION DATAREQUEST

Page 17: Journey Through the Cloud - Scalable Web Apps

1

DNS APPLICATION DATAREQUESTRegion

Region

Elastic Load

Balancer

Elastic Load

BalancerAvailability Zone

Availability Zone

Availability Zone

Availability Zone

Elastic load balancing Multi-availability zone Multi-region

Service all requests

Page 18: Journey Through the Cloud - Scalable Web Apps

1

DNS APPLICATION DATAREQUESTRegion

Region

Elastic Load

Balancer

Elastic Load

BalancerAvailability Zone

Availability Zone

Availability Zone

Availability Zone

Amazon DynamoDB

Amazon DynamoDB

Service all requests

Page 19: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible2

Page 20: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 1) Chose the ‘closest’ endpoint

2

REQUEST Amazon Route 53

Region A Region B

Page 21: Journey Through the Cloud - Scalable Web Apps

2

REQUEST Amazon Route 53

Region A Region B

16ms 92ms

Service requests as fast as possible 1) Chose the ‘closest’ endpoint

Page 22: Journey Through the Cloud - Scalable Web Apps

2

REQUEST Amazon Route 53

Region A Region B

16ms 92ms

Service requests as fast as possible 1) Chose the ‘closest’ endpoint

Page 23: Journey Through the Cloud - Scalable Web Apps

2

Amazon Route 53

Region A Region B

16ms

REGION A DNS ENTRY

REQUEST

Service requests as fast as possible 1) Chose the ‘closest’ endpoint

Page 24: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 2) Offload your application servers

2

London

Paris

NY

Served from S3 /images/*

3

Served from EC2 *.php

2

Single CNAME www.mysite.com1

Amazon CloudFront Content delivery web service

Integrates with other Amazon Web Services Products

Easily distribute content to end users with low latency, high data transfer speeds, and no minimum usage commitments

aws.amazon.com/cloudfront

Page 25: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 2) Offload your application servers

2

Without Amazon CloudFront EC2 Instances running web and application servers are loaded with user requests for content assets

Page 26: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 2) Offload your application servers

2

With Amazon CloudFront A significant proportion of the load from user requests is handled by Amazon CloudFront and the EC2 cluster can be scaled down

OffloadScale Down

Page 27: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 2) Offload your application servers

2

OffloadScale Down

Resp

onse

Tim

e

Serv

er L

oad

Resp

onse

Tim

e

Serv

er L

oad

Resp

onse

Tim

e

Serv

er

Load

No CDN CDN for Static

Content

CDN for Static & Dynamic Content

Page 28: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 3) Cache it if you can

2

Amazon ElastiCache A web service that makes it easy to deploy, operate, and scale an in-memory cache

Allows you to retrieve information from fast, managed, in-memory caches, instead of relying entirely on slower disk-based databases

Supports two open-source in memory caching engines: Memcached & Redis

Page 29: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 4) Single digit latencies where it matters

2Da

taba

se Q

uery

Per

form

ance

Desired consistency & predictability

Scale

Page 30: Journey Through the Cloud - Scalable Web Apps

Service requests as fast as possible 4) Single digit latencies where it matters

2Da

taba

se Q

uery

Per

form

ance

Desired consistency & predictability

Scale

Actual performance degrades with scale

Page 31: Journey Through the Cloud - Scalable Web Apps

Data

base

Que

ry P

erfo

rman

ce

Desired consistency & predictability

Scale

Actual performance degrades with scale

Filling this gap requires:

Database sharding Data caching Provisioning

Cluster management Fault management

Service requests as fast as possible 4) Single digit latencies where it matters

2

Page 32: Journey Through the Cloud - Scalable Web Apps

Data

base

Que

ry P

erfo

rman

ce

Amazon DynamoDB Query Performance

Scale

Relational Database Query Performance

Amazon DynamoDB

Service requests as fast as possible 4) Single digit latencies where it matters

2

Page 33: Journey Through the Cloud - Scalable Web Apps

Amazon DynamoDB

Amazon DynamoDB A fast and flexible NoSQL database service

Consistent, single-digit millisecond latency at any scale

Fully managed

Supports both document & key-value store models

aws.amazon.com/dynamodb

Service requests as fast as possible 4) Single digit latencies where it matters

2

aws.amazon.com/solutions/case-studies/adroll/

Page 34: Journey Through the Cloud - Scalable Web Apps

3 Handle requests at any volume & scale 1) Scale up

Basic unit of compute capacity Broad range of CPU, memory & local disk options 7 families available, from micro to compute, memory & storage optimized

Scale up with Elastic Compute Cloud (EC2)

Page 35: Journey Through the Cloud - Scalable Web Apps

3 Handle requests at any volume & scale 2) Scale out

Trigger  auto-­‐scaling  policy

Auto Scaling

Amazon EC2 Auto Scaling Allows you to scale your EC2 capacity up or down automatically according to conditions that you define

Increase the number of Amazon EC2 instances during demand spikes to maintain performance & decrease capacity during lulls to reduce costs

Page 36: Journey Through the Cloud - Scalable Web Apps

3

Manually

Send an API call or use CLI to launch/terminate instances – Only need to

specify capacity change (+/-)

By Schedule

Scale up/down based on date and time

By Policy

Scale in response to changing conditions, based on user configured

real-time monitoring and alerts

Auto-Rebalance

Instances are automatically launched/terminated to ensure the application is

balanced across multiple Azs

Handle requests at any volume & scale 2) Scale out

Page 37: Journey Through the Cloud - Scalable Web Apps

3

Manually

Send an API call or use CLI to launch/terminate instances – Only need to

specify capacity change (+/-)

By Schedule

Scale up/down based on date and time

By Policy

Scale in response to changing conditions, based on user configured

real-time monitoring and alerts

Auto-Rebalance

Instances are automatically launched/terminated to ensure the application is

balanced across multiple Azs

Preemptive manual scaling of capacity

Adding 10 more instances before a marketing event

Handle requests at any volume & scale 2) Scale out

Page 38: Journey Through the Cloud - Scalable Web Apps

3

Manually

Send an API call or use CLI to launch/terminate instances – Only need to

specify capacity change (+/-)

By Schedule

Scale up/down based on date and time

By Policy

Scale in response to changing conditions, based on user configured

real-time monitoring and alerts

Auto-Rebalance

Instances are automatically launched/terminated to ensure the application is

balanced across multiple Azs

Preemptive manual scaling of capacity

Adding 10 more instances before a marketing event

Regular scaling up & down of instances

Scaling from 0 to 2 to process SQS messages every night or doubling

capacity on a Friday night

Handle requests at any volume & scale 2) Scale out

Page 39: Journey Through the Cloud - Scalable Web Apps

3

Manually

Send an API call or use CLI to launch/terminate instances – Only need to

specify capacity change (+/-)

By Schedule

Scale up/down based on date and time

By Policy

Scale in response to changing conditions, based on user configured

real-time monitoring and alerts

Auto-Rebalance

Instances are automatically launched/terminated to ensure the application is

balanced across multiple Azs

Preemptive manual scaling of capacity

Adding 10 more instances before a marketing event

Regular scaling up & down of instances

Scaling from 0 to 2 to process SQS messages every night or doubling

capacity on a Friday night

Dynamic scaling based on custom metrics

Scaling on SQS queue depth, average CPU load or ELB latency

Handle requests at any volume & scale 2) Scale out

Page 40: Journey Through the Cloud - Scalable Web Apps

3

Manually

Send an API call or use CLI to launch/terminate instances – Only need to

specify capacity change (+/-)

By Schedule

Scale up/down based on date and time

By Policy

Scale in response to changing conditions, based on user configured

real-time monitoring and alerts

Auto-Rebalance

Instances are automatically launched/terminated to ensure the application is

balanced across multiple Azs

Preemptive manual scaling of capacity

Adding 10 more instances before a marketing event

Regular scaling up & down of instances

Scaling from 0 to 2 to process SQS messages every night or doubling

capacity on a Friday night

Dynamic scaling based on custom metrics

Scaling on SQS queue depth, average CPU load or ELB latency

Maintaining capacity across availability zones

Instance availability is maintained in the event of AZ becoming unavailable

Handle requests at any volume & scale 2) Scale out

Page 41: Journey Through the Cloud - Scalable Web Apps

3 Handle requests at any volume & scale 3) Dial up throughout

Elastic Block Store

Provisioned IOPS up to 20,000 per EBS volume

Predictable performance for demanding workloads such as

databases

DynamoDB

Provisioned read/write performance per table

Predictable high performance scaled via console or API

https://aws.amazon.com/blogs/aws/auto-scale-dynamodb-with-dynamic-dynamodb/

Page 42: Journey Through the Cloud - Scalable Web Apps

Simply your architecture with services4

Perfection is achieved, not when there is nothing more to add, but when there is

nothing left to take away            

Antoine de Saint-ExuperyFrench writer (1900 - 1944)

Page 43: Journey Through the Cloud - Scalable Web Apps

4

YourBusiness

70%

Infrastructure that you own

& operate

30%

Managing All of the “Undifferentiated Heavy Lifting”

Simply your architecture with services

Page 44: Journey Through the Cloud - Scalable Web Apps

4

YourBusiness

70%

Infrastructure that you own

& operate

30%

Managing All of the “Undifferentiated Heavy Lifting”

AWSCloud-BasedInfrastructure

More Time to Focus on Your Business

Configuring Your Cloud Services

30%70%

Simply your architecture with services

Page 45: Journey Through the Cloud - Scalable Web Apps

4 Simply your architecture with services

Relational Database Service Database-as-a-Service No need to install or manage database instances Scalable and fault tolerant configurations

DynamoDB Provisioned throughput NoSQL database

Fast, predictable performance Fully distributed, fault tolerant architecture

Use RDS for relational databases such as

MySQL or Oracle

Use DynamoDB as high performance document

or key-value database

Page 46: Journey Through the Cloud - Scalable Web Apps

4 Simply your architecture with services

Amazon SQS Reliable, highly scalable, queue service for storing messages as they travel between instances

Reliable message queuing without

additional software

Elastic MapReduce Elastic Hadoop cluster Integrates with S3 & DynamoDB Leverage Hive & Pig analytics scripts Integrates with instance types such as spot

Process large volumes of data cost effectively with

Amazon EMR

Amazon SQS

Processing task/processing trigger

Processing results

Page 47: Journey Through the Cloud - Scalable Web Apps

4 Simply your architecture with services

Enterprise Applications

Administration & Security

Core Services

Platform Services

Infrastructure

AWS Marketplace

Page 48: Journey Through the Cloud - Scalable Web Apps

5

Access everything via CLI, API or Console

Achieve the highest levels of automation with ease

Find out more at: aws.amazon.com/developers/getting-started/

Automate operations & management 1) Everything is programmable

Page 49: Journey Through the Cloud - Scalable Web Apps

5 Automate operations & management 2) Think immutable, one click-deployments

AWS CloudFormation An easy way to create & manage a collection of related AWS resources, called a ‘stack’ Automate creation of ‘stacks’ in a repeatable way Version control your infrastructure as you do your software

Feature Details

Platform support Support for AWS resources from EC2 to IAM

Resource creation Creates AWS resources behind the scenes and reports on progress

Declarative Specify stacks in JSON format and source control your environments

Customizable Drive stack creation with paramaters

Page 50: Journey Through the Cloud - Scalable Web Apps

5 Automate operations & management 2) Think immutable, one click-deployments

Launch and terminate Docker containers

Across a cluster of EC2 instances

Mount persistent volumes at launch

Private Docker repositories

Amazon EC2 Container Service

Page 51: Journey Through the Cloud - Scalable Web Apps

5 Automate operations & management 2) Think immutable, one click-deployments

Amazon EC2 Container Service

Page 52: Journey Through the Cloud - Scalable Web Apps

5 Automate operations & management 3) Design for availability, implement self healing

Customize instance startup

Get instances to ask ‘who am I?’ question on startup and be

configured dynamically upon being answered

Maintain capacity of instances

Using a minimum pool size will maintain capacity in the event

of instance failures

Know what’s going on, take automated actions

Use CloudWatch standard and custom metrics to create alarms.

Respond with automated administration actions

Bootstrapping Auto-scaling CloudWatch

Page 53: Journey Through the Cloud - Scalable Web Apps

5 Automate operations & management 3) Design for availability, implement self healing

https://github.com/Netflix/SimianArmy

Page 54: Journey Through the Cloud - Scalable Web Apps

6 Use the unique properties of the cloud 1) Optimize costs with different instance types

Choose an instance that best meets your basic

requirements

Start with memory & then choose closest virtual cores

Assess peak IOPS storage requirements

Deploy & run multiple instances in multiple Availability Zones

Change instance size up or down based upon monitoring

Use CloudWatch & Trusted Advisor to assess

Start Deploy & ScaleTune

Page 55: Journey Through the Cloud - Scalable Web Apps

6 Use the unique properties of the cloud 1) Optimize costs with different instance types

00:00 01:00 02:00 03:00 04:00 05:00 06:00 07:00 08:00 09:00 10:00 11:00 12:00 13:00 14:00 15:00 16:00 17:00 18:00 19:00 20:00 21:00 22:00 23:00

100%

75%

58%

38%

13%

8%On Demand Instance

Reserved Instance

Page 56: Journey Through the Cloud - Scalable Web Apps

COMMON PATTERNS FORWEB APPLICATIONS

Page 57: Journey Through the Cloud - Scalable Web Apps

Stateless

Scale horizontally

Loose coupling

Automation

Page 58: Journey Through the Cloud - Scalable Web Apps

RESOURCES YOU CAN USETO LEARN MORE

Page 59: Journey Through the Cloud - Scalable Web Apps

aws.amazon.com/websites/

Page 60: Journey Through the Cloud - Scalable Web Apps

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

Page 61: Journey Through the Cloud - Scalable Web Apps

aws.amazon.com/architecture/

Page 62: Journey Through the Cloud - Scalable Web Apps

Certification

aws.amazon.com/certification

Self-Paced Labs

aws.amazon.com/training/self-paced-labs

Try products, gain new skills, and get hands-on practice working

with AWS technologies

aws.amazon.com/training

Training

Validate your proven skills and expertise with the AWS platform

Build technical expertise to design and operate scalable, efficient applications on AWS

AWS Training & Certification

Page 63: Journey Through the Cloud - Scalable Web Apps

Follow us fo

r more

events

& webina

rs

@AWScloud for Global AWS News & Announcements

@AWS_UKI for local AWS events & news

@IanMmmmIan Massingham — Technical Evangelist