Slide 1

Slide 1 text

High Performance Web Applications [email protected] Dr. Matt Wood @mza

Slide 2

Slide 2 text

Hello

Slide 3

Slide 3 text

Building blocks for wonderful applications Storage, compute, databases, managed services

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

Retail Merchant services Web services

Slide 6

Slide 6 text

Retail Merchant services Web services

Slide 7

Slide 7 text

Getting started with Amazon Web Services quick review H

Slide 8

Slide 8 text

Utility computing Available at the end of an API call. Metered billing. H

Slide 9

Slide 9 text

Family of 20 services Adding new services and refinement weekly. Rapid rate of innovation. H

Slide 10

Slide 10 text

Undi!erentiated heavy lifting Focus on your app, customers and business H

Slide 11

Slide 11 text

H

Slide 12

Slide 12 text

aws.amazon.com H Free account. Free tier.

Slide 13

Slide 13 text

Building High Performance Web Applications r

Slide 14

Slide 14 text

Deliver a great experience to your customers. Responsive, fast web applications. r

Slide 15

Slide 15 text

g DECOUPLED SCALE OUT S OPTIMIZE COST FOR C AUTOMATE v CALIBRATED FOR: CPU performance v CALIBRATED FOR: IO performance 5patterns for performance

Slide 16

Slide 16 text

g DECOUPLED

Slide 17

Slide 17 text

Monolithic Mega System v2

Slide 18

Slide 18 text

Application Assets Analytics

Slide 19

Slide 19 text

Application Assets Analytics

Slide 20

Slide 20 text

Images, javascript, stylesheets, HTML pages Deliver as fast as possible to customers r

Slide 21

Slide 21 text

Websites without the servers Highly durable: 99.999999999% Zero config: fire and forget r

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

Low latency delivery of assets Local caching for fast downloads Amazon CloudFront r

Slide 24

Slide 24 text

P P

Slide 25

Slide 25 text

Create content distributions From objects in S3 Any custom origin Dynamic, streaming and static content r

Slide 26

Slide 26 text

P P P

Slide 27

Slide 27 text

CNAME? Map to any custom URL assets.domain.com, www.domain.com r

Slide 28

Slide 28 text

Application Assets Analytics

Slide 29

Slide 29 text

Application Assets Analytics

Slide 30

Slide 30 text

Application architecture Small things, loosely coupled r

Slide 31

Slide 31 text

Application Assets Analytics

Slide 32

Slide 32 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 33

Slide 33 text

Shared responsibility Infrastructure by AWS OS, application and data by customers Tools to help meet best practices r

Slide 34

Slide 34 text

Security groups Customer controlled firewalls All ports are closed by default r

Slide 35

Slide 35 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 36

Slide 36 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics x

Slide 37

Slide 37 text

Decoupling provides an architectural framework for performance Easier to separate concerns: assets, streaming, etc. Easier to manage and scale. r

Slide 38

Slide 38 text

SCALE OUT

Slide 39

Slide 39 text

Elasticity is a tenet of the cloud Scale up when you need to Scale down when you don’t r

Slide 40

Slide 40 text

Predictable peaks r Time Demand Capacity

Slide 41

Slide 41 text

Predictable peaks r Time Demand Capacity

Slide 42

Slide 42 text

Variable usage r Time Demand Capacity

Slide 43

Slide 43 text

Variable usage r Time Demand Capacity

Slide 44

Slide 44 text

Variable usage r Time Demand

Slide 45

Slide 45 text

Horizontal scaling drives performance up ...and costs down r

Slide 46

Slide 46 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 47

Slide 47 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 48

Slide 48 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 49

Slide 49 text

Amazon Machine Images encapsulate your app Customize your virtual machines AMI can be the unit of deployment r

Slide 50

Slide 50 text

1. Spin up a new instance using your AMI Configured to bootstrap the app. r

Slide 51

Slide 51 text

2. Pull down latest code base From S3 or code repository r

Slide 52

Slide 52 text

3. Start up the app on the instance Ready to receive requests r

Slide 53

Slide 53 text

4. Register with the load balancer Job done. r

Slide 54

Slide 54 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 55

Slide 55 text

Horizontal scaling allows for fault tolerance r

Slide 56

Slide 56 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 57

Slide 57 text

Load balancer App servers Database Asynchronous processing :( Application Assets Analytics

Slide 58

Slide 58 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 59

Slide 59 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 60

Slide 60 text

Deploying and scaling a datastore r Follow the same patterns: horizontal scale, availability, automation.

Slide 61

Slide 61 text

One question: r Does your application require a strict, controlled schema for query flexibility?

Slide 62

Slide 62 text

Amazon Relational Database Service r Management systems: CRM, ERP, finance Does your application require a strict, controlled schema for query flexibility? Yes

Slide 63

Slide 63 text

Focus on your app r Handles tedious database admin tasks Designed for availability

Slide 64

Slide 64 text

Multi-engine r MySQL, Oracle, Microsoft SQL Server Up and running in six clicks

Slide 65

Slide 65 text

Point in time snapshots r Automatic. Easy recovery.

Slide 66

Slide 66 text

High availability r Deployed across multiple availability zones. Synchronous writes.

Slide 67

Slide 67 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 68

Slide 68 text

Read replicas r Perfect for read heavy applications. Asynchronous writes. Replication metrics available.

Slide 69

Slide 69 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 70

Slide 70 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 71

Slide 71 text

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 schema for query flexibility? No

Slide 72

Slide 72 text

Focus on your app r Managed NoSQL database service. No schema.

Slide 73

Slide 73 text

Unlimited scale r Unlimited storage Pay as you go

Slide 74

Slide 74 text

High performance r Single digit millisecond latencies

Slide 75

Slide 75 text

Zero admin r No instances to manage Tiny API, perfectly formed

Slide 76

Slide 76 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 77

Slide 77 text

Asynchronous processing r Resize images. Transcode movies. Resample media.

Slide 78

Slide 78 text

Follow the same best practices r Decouple. Stateless. Horizontal scale.

Slide 79

Slide 79 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 80

Slide 80 text

CloudFront for dynamic content r Edge caching for dynamic content Cache by query string parameters Multiple origin servers Persistent connections to origin servers

Slide 81

Slide 81 text

C AUTOMATE

Slide 82

Slide 82 text

Automate everything The tedious. The time consuming. The error prone. r

Slide 83

Slide 83 text

For example: when increasing capacity Launch instance. Update application code. Register with load balancer. r

Slide 84

Slide 84 text

Auto-scaling CloudWatch Auto-scaling service Elastic Load Balancer r

Slide 85

Slide 85 text

Set operational thresholds Network capacity > 80% Memory utilization > 75% CPU < 50% r

Slide 86

Slide 86 text

Automatically respond to operational alarms r Network capacity > 80%: add instances Memory utilization > 75%: add instances CPU < 50%: remove instances

Slide 87

Slide 87 text

Set bounds Step change configured by number or percentage of instances r

Slide 88

Slide 88 text

Custom metrics Respond to custom metrics Page load time Database query time r

Slide 89

Slide 89 text

Automatic load balancer configuration Instances added/removed automatically Health check for running application before routing tra"c r

Slide 90

Slide 90 text

Stateless operations are important Decoupled, but stateless Instances are naive to other instances r

Slide 91

Slide 91 text

Treat your data as a royal garden Backup to S3: high durability Compute is a disposable resource r

Slide 92

Slide 92 text

v CALIBRATED FOR: CPU performance

Slide 93

Slide 93 text

Range of resources Choose the best instance type for performance r

Slide 94

Slide 94 text

r t1.micro m1.small cc2.8xlarge

Slide 95

Slide 95 text

r t1.micro m1.small cc2.8xlarge High memory High CPU High CPU + memory

Slide 96

Slide 96 text

Load balancer App servers Database Asynchronous processing Application Assets Analytics

Slide 97

Slide 97 text

1 instance for 100 hours = 100 instances for 1 hour

Slide 98

Slide 98 text

Balance cost/performance Mix instance types for application servers, databases, ancillary services, analytics etc. r

Slide 99

Slide 99 text

Migrate to large instance types As your application grows Use 64 bit from the outset, if possible r

Slide 100

Slide 100 text

v CALIBRATED FOR: IO performance

Slide 101

Slide 101 text

IO bound web applications are more common Application requires predictable, consistent IO r

Slide 102

Slide 102 text

Provisioned throughput with DynamoDB No need to provision storage Provision IO requirements: reads and writes per second r

Slide 103

Slide 103 text

No content

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

No content

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

Scale up, and carry on DynamoDB will manage resources to achieve and maintain throughput r

Slide 108

Slide 108 text

Low latency, unlimited scale Writes acknowledged when saved to disk in multiple data centres. Backed on SSDs. r

Slide 109

Slide 109 text

...and SSDs for all

Slide 110

Slide 110 text

hi1.4xlarge instances High capacity, high performance storage 2 x 1Tb SSD drives r

Slide 111

Slide 111 text

Perfect match for databases Relational and NoSQL storage r

Slide 112

Slide 112 text

Perfect match for databases Relational and NoSQL storage 90k to 120k IOPS r

Slide 113

Slide 113 text

High performance network 10 gigabit ethernet Placement groups Perfect for distributed stores r

Slide 114

Slide 114 text

S OPTIMIZE COST FOR

Slide 115

Slide 115 text

Economies of scale Drive down prices for customers 20 price drops in past 6 years r

Slide 116

Slide 116 text

Maximize utilization Greater utilization drives down cost r

Slide 117

Slide 117 text

Reserved capacity Time Utilization

Slide 118

Slide 118 text

Reserved instances Small upfront payment Guaranteed capacity for 1 or 3 years Lower hourly rate r

Slide 119

Slide 119 text

Reserved instance resale Sell your reservations on the resale market Sellers set your own price Buyers select and check out r

Slide 120

Slide 120 text

Reserved capacity Time Utilization

Slide 121

Slide 121 text

Reserved capacity On-demand Time Utilization

Slide 122

Slide 122 text

Reserved capacity On-demand Time Utilization

Slide 123

Slide 123 text

Spot instances Name your price computing r

Slide 124

Slide 124 text

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

Slide 125

Slide 125 text

Load balancer App servers Database on SSDs Asynchronous processing Application Assets Analytics

Slide 126

Slide 126 text

Load balancer App servers Database on SSDs Asynchronous processing Application Assets Analytics

Slide 127

Slide 127 text

Load balancer App servers Database on SSDs Asynchronous processing Application Assets Analytics

Slide 128

Slide 128 text

Become price aware Price is a driver of your architecture r

Slide 129

Slide 129 text

Automated bidding Automate bids based on on-demand price Run on spot only when cost e!ective r

Slide 130

Slide 130 text

Continuous cost optimization Evaluate your reserved instance/on-demand/ spot mix regularly as app requirements change r

Slide 131

Slide 131 text

5patterns for performance g DECOUPLED

Slide 132

Slide 132 text

5patterns for performance g DECOUPLED SCALE OUT

Slide 133

Slide 133 text

5patterns for performance g DECOUPLED SCALE OUT S OPTIMIZE COST FOR

Slide 134

Slide 134 text

5patterns for performance g DECOUPLED SCALE OUT S OPTIMIZE COST FOR v CALIBRATED FOR: CPU performance v CALIBRATED FOR: IO performance

Slide 135

Slide 135 text

5patterns for performance g DECOUPLED SCALE OUT S OPTIMIZE COST FOR v CALIBRATED FOR: CPU performance v CALIBRATED FOR: IO performance C AUTOMATE

Slide 136

Slide 136 text

Thank you aws.amazon.com @mza [email protected]