High Performance Web Applications

Post on 05-Dec-2014

7780 Views

Category:

Technology

4 Downloads

Preview:

Click to see full reader

DESCRIPTION

Building high performance web applications with Amazon Web Services.

Transcript

High PerformanceWeb Applications

matthew@amazon.comDr. Matt Wood

@mza

Hello

Building blocks for wonderful applicationsStorage, compute, databases, managed services

Retail Merchantservices

Web services

Retail Merchantservices

Web services

Getting started withAmazon Web Services

quick review

H

Utility computing

Available at the end of an API call.Metered billing.

H

Family of 20 services

Adding new services and refinement weekly.Rapid rate of innovation.

H

Undi!erentiated heavy lifting

Focus on your app, customers and business

H

H

aws.amazon.com

H

Free account. Free tier.

Building High PerformanceWeb Applications

r

Deliver a great experience toyour customers.

Responsive, fast web applications.

r

g DECOUPLEDSCALE

OUT SOPTIMIZE COSTFOR

CAUTOMATE

vCALIBRATED FOR:

CPU performance vCALIBRATED FOR:

IO performance

5 patterns forperformance

g DECOUPLED

Monolithic Mega System v2

Application

Assets

Analytics

Application

Assets

Analytics

Images, javascript, stylesheets, HTML pages

Deliver as fast as possible to customers

r

Websites without the servers

Highly durable: 99.999999999%Zero config: fire and forget

r

Low latency delivery of assets

Local caching for fast downloadsAmazon CloudFront

r

PP

Create content distributions

From objects in S3Any custom originDynamic, streaming and static content

r

PPP

CNAME?

Map to any custom URLassets.domain.com, www.domain.com

r

Application

Assets

Analytics

Application

Assets

Analytics

Application architecture

Small things, loosely coupled

r

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Shared responsibility

Infrastructure by AWSOS, application and data by customersTools to help meet best practices

r

Security groups

Customer controlled firewallsAll ports are closed by default

r

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

x

Decoupling provides an architectural framework for performance

Easier to separate concerns: assets, streaming, etc.Easier to manage and scale.

r

SCALE

OUT

Elasticity is a tenet of the cloud

Scale up when you need toScale down when you don’t

r

Predictable peaksr

Time

Demand

Capacity

Predictable peaksr

Time

Demand

Capacity

Variable usager

Time

Demand

Capacity

Variable usager

Time

Demand

Capacity

Variable usager

Time

Demand

Horizontal scaling drives performance up

...and costs down

r

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Amazon Machine Images encapsulate your app

Customize your virtual machines AMI can be the unit of deployment

r

1. Spin up a new instance using your AMI

Configured to bootstrap the app.

r

2. Pull down latest code base

From S3 or code repository

r

3. Start up the app on the instance

Ready to receive requests

r

4. Register with the load balancer

Job done.

r

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Horizontal scaling allows forfault tolerance

r

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

:(

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Deploying and scaling a datastore

r

Follow the same patterns: horizontal scale, availability, automation.

One question:

r

Does your application require a strict, controlled schema for query flexibility?

Amazon Relational Database Service

r

Management systems: CRM, ERP, finance

Does your application require a strict, controlled schemafor query flexibility? Yes

Focus on your app

r

Handles tedious database admin tasksDesigned for availability

Multi-engine

r

MySQL, Oracle, Microsoft SQL ServerUp and running in six clicks

Point in time snapshots

r

Automatic. Easy recovery.

High availability

r

Deployed across multiple availability zones.Synchronous writes.

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Read replicas

r

Perfect for read heavy applications.Asynchronous writes. Replication metrics available.

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Amazon DynamoDB

r

Web apps, social apps, mobile apps, user generated content, unstructured data integration, lots of data.

Does your application require a strict, controlled schemafor query flexibility? No

Focus on your app

r

Managed NoSQL database service.No schema.

Unlimited scale

r

Unlimited storagePay as you go

High performance

r

Single digit millisecond latencies

Zero admin

r

No instances to manageTiny API, perfectly formed

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

Asynchronous processing

r

Resize images. Transcode movies. Resample media.

Follow the same best practices

r

Decouple. Stateless. Horizontal scale.

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

CloudFront for dynamic content

r

Edge caching for dynamic contentCache by query string parametersMultiple origin serversPersistent connections to origin servers

CAUTOMATE

Automate everything

The tedious. The time consuming. The error prone.

r

For example: when increasing capacity

Launch instance.Update application code.Register with load balancer.

r

Auto-scaling

CloudWatchAuto-scaling serviceElastic Load Balancer

r

Set operational thresholds

Network capacity > 80%Memory utilization > 75%CPU < 50%

r

Automatically respond to operational alarms

r

Network capacity > 80%: add instancesMemory utilization > 75%: add instancesCPU < 50%: remove instances

Set bounds

Step change configured by number or percentage of instances

r

Custom metrics

Respond to custom metricsPage load timeDatabase query time

r

Automatic load balancer configuration

Instances added/removed automaticallyHealth check for running application before routing tra"c

r

Stateless operations are important

Decoupled, but statelessInstances are naive to other instances

r

Treat your data as a royal garden

Backup to S3: high durabilityCompute is a disposable resource

r

vCALIBRATED FOR:

CPU performance

Range of resources

Choose the best instance type for performance

r

r

t1.micro m1.small cc2.8xlarge

r

t1.micro m1.small cc2.8xlarge

High memory

High CPU

High CPU + memory

Load balancer

App servers

Database

Asynchronous processing

Application

Assets

Analytics

1 instance for 100 hours=

100 instances for 1 hour

Balance cost/performance

Mix instance types for application servers, databases, ancillary services, analytics etc.

r

Migrate to large instance types

As your application grows Use 64 bit from the outset, if possible

r

vCALIBRATED FOR:

IO performance

IO bound web applications are more common

Application requires predictable, consistent IO

r

Provisioned throughput with DynamoDB

No need to provision storageProvision IO requirements: reads and writes per second

r

Scale up, and carry on

DynamoDB will manage resources to achieve and maintain throughput

r

Low latency, unlimited scale

Writes acknowledged when saved to disk in multiple data centres. Backed on SSDs.

r

...and SSDs for all

hi1.4xlarge instances

High capacity, high performance storage2 x 1Tb SSD drives

r

Perfect match for databases

Relational and NoSQL storage

r

Perfect match for databases

Relational and NoSQL storage90k to 120k IOPS

r

High performance network

10 gigabit ethernetPlacement groupsPerfect for distributed stores

r

SOPTIMIZE COSTFOR

Economies of scale

Drive down prices for customers20 price drops in past 6 years

r

Maximize utilization

Greater utilization drives down cost

r

Reserved capacity

Time

Utilization

Reserved instances

Small upfront paymentGuaranteed capacity for 1 or 3 yearsLower hourly rate

r

Reserved instance resale

Sell your reservations on the resale marketSellers set your own priceBuyers select and check out

r

Reserved capacity

Time

Utilization

Reserved capacity

On-demand

Time

Utilization

Reserved capacity

On-demand

Time

Utilization

Spot instances

Name your price computing

r

Spot instances

Lower costs‘Overclock’ your app: more bang for your buck

r

Load balancer

App servers

Database on SSDs

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database on SSDs

Asynchronous processing

Application

Assets

Analytics

Load balancer

App servers

Database on SSDs

Asynchronous processing

Application

Assets

Analytics

Become price aware

Price is a driver of your architecture

r

Automated bidding

Automate bids based on on-demand priceRun on spot only when cost e!ective

r

Continuous cost optimization

Evaluate your reserved instance/on-demand/spot mix regularly as app requirements change

r

5 patterns forperformance

g DECOUPLED

5 patterns forperformance

g DECOUPLEDSCALE

OUT

5 patterns forperformance

g DECOUPLEDSCALE

OUT SOPTIMIZE COSTFOR

5 patterns forperformance

g DECOUPLEDSCALE

OUT SOPTIMIZE COSTFOR

vCALIBRATED FOR:

CPU performance vCALIBRATED FOR:

IO performance

5 patterns forperformance

g DECOUPLEDSCALE

OUT SOPTIMIZE COSTFOR

vCALIBRATED FOR:

CPU performance vCALIBRATED FOR:

IO performanceC

AUTOMATE

top related