Scalable Web Application



Similar documents
High-Availability in the Cloud Architectural Best Practices

Scalable Architecture on Amazon AWS Cloud

Web Application Hosting in the AWS Cloud Best Practices

Preparing Your IT for the Holidays. A quick start guide to take your e-commerce to the Cloud

Web Application Hosting in the AWS Cloud Best Practices

On- Prem MongoDB- as- a- Service Powered by the CumuLogic DBaaS Platform

The Total Cost of (Non) Ownership of a NoSQL Database Cloud Service

Cloud Based Application Architectures using Smart Computing

Making Your ColdFusion Apps Highly Available. Brian Klaas Johns Hopkins Bloomberg School of Public Health

Scalability of web applications. CSCI 470: Web Science Keith Vertanen

Reference Model for Cloud Applications CONSIDERATIONS FOR SW VENDORS BUILDING A SAAS SOLUTION

TECHNOLOGY WHITE PAPER Jun 2012

Web Application Deployment in the Cloud Using Amazon Web Services From Infancy to Maturity

EXECUTIVE SUMMARY CONTENTS. 1. Summary 2. Objectives 3. Methodology and Approach 4. Results 5. Next Steps 6. Glossary 7. Appendix. 1.

How AWS Pricing Works May 2015

Monitoring and Scaling My Application

Migrating a running service to AWS

Drupal in the Cloud. Scaling with Drupal and Amazon Web Services. Northern Virginia Drupal Meetup

TECHNOLOGY WHITE PAPER Jan 2016

Why NoSQL? Your database options in the new non- relational world IBM Cloudant 1

Design for Failure High Availability Architectures using AWS

ArcGIS 10.3 Server on Amazon Web Services

Designing Apps for Amazon Web Services

Database Scalability {Patterns} / Robert Treat

Scaling in the Cloud with AWS. By: Eli White (CTO & mojolive) eliw.com - mojolive.com

Software- as- a- Service (SaaS) on AWS Business and Architecture Overview

Big data blue print for cloud architecture

Are You Ready for the Holiday Rush?

DISTRIBUTED SYSTEMS [COMP9243] Lecture 9a: Cloud Computing WHAT IS CLOUD COMPUTING? 2

How AWS Pricing Works

BASICS OF SCALING: LOAD BALANCERS

Amazon Elastic Beanstalk

Analytics March 2015 White paper. Why NoSQL? Your database options in the new non-relational world

MakeMyTrip CUSTOMER SUCCESS STORY

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

Benchmarking Couchbase Server for Interactive Applications. By Alexey Diomin and Kirill Grigorchuk

MySQL and Virtualization Guide

Evaluator s Guide. McKnight. Consulting Group. McKnight Consulting Group

Migration Scenario: Migrating Backend Processing Pipeline to the AWS Cloud

Deploying Adobe Experience Manager DAM: Architecture blueprints and best practices

APPLICATION NOTE. Elastic Scalability. for HetNet Deployment, Management & Optimization

How To Choose Between A Relational Database Service From Aws.Com

High Availability of VistA EHR in Cloud. ViSolve Inc. White Paper February

Best Practices for Managing Storage in the Most Challenging Environments

Rapid Bottleneck Identification A Better Way to do Load Testing. An Oracle White Paper June 2009

Building Success on Acquia Cloud:

Fault-Tolerant Computer System Design ECE 695/CS 590. Putting it All Together

The High-Performance Cloud Infrastructure Company! 2011 Joyent, Inc. Contains Joyent Restricted Secrets. Not for Public Disclosure. Patents Pending.!

3/21/2011. Topics. What is load balancing? Load Balancing

Cluster Computing. ! Fault tolerance. ! Stateless. ! Throughput. ! Stateful. ! Response time. Architectures. Stateless vs. Stateful.

ArcGIS for Server in the Amazon Cloud. Michele Lundeen Esri

SOLUTION BRIEF Seven Secrets to High Availability in the Cloud

Using MySQL for Big Data Advantage Integrate for Insight Sastry Vedantam

Deploying Splunk on Amazon Web Services

NoSQL Database Options

Topics. 1. What is load balancing? 2. Load balancing techniques 3. Load balancing strategies 4. Sessions 5. Elastic load balancing

Reliable Data Tier Architecture for Job Portal using AWS

Scaling Pinterest. Yash Nelapati Ascii Artist. Pinterest Engineering. Saturday, August 31, 13

High Availability Using MySQL in the Cloud:

ScaleArc idb Solution for SQL Server Deployments

An Oracle White Paper February Rapid Bottleneck Identification - A Better Way to do Load Testing

Leveraging InstaCompute for Scalable Web Hosting. InstaCompute Whitepaper July

HYPER-CONVERGED INFRASTRUCTURE STRATEGIES

Amazon Web Services Student Tutorial

PostgreSQL Performance Characteristics on Joyent and Amazon EC2

JAVA IN THE CLOUD PAAS PLATFORM IN COMPARISON


Technical Overview Simple, Scalable, Object Storage Software

Software Performance, Scalability, and Availability Specifications V 3.0

HEY, YOU, GET OFF OF MY CLOUD: EXPLORING INFORMATION LEAKAGE

Understanding Neo4j Scalability

Accelerating Enterprise Applications and Reducing TCO with SanDisk ZetaScale Software

Cloud Computing and Amazon Web Services

Tableau Server 7.0 scalability

Java, PHP & Ruby - Cloud Hosting

Postgres Plus Cloud Database!

Tableau Server Scalability Explained

Multi-Datacenter Replication

In Memory Accelerator for MongoDB

Cloud Computing: Meet the Players. Performance Analysis of Cloud Providers

SCALABILITY IN THE CLOUD

solution brief September 2011 Can You Effectively Plan For The Migration And Management of Systems And Applications on Vblock Platforms?

CS 188/219. Scalable Internet Services Andrew Mutz October 8, 2015

Learning Management Redefined. Acadox Infrastructure & Architecture

Cloud Computing with Amazon Web Services and the DevOps Methodology.

Transcription:

Scalable Web Applications Reference Architectures and Best Practices Brian Adler, PS Architect 1 Scalable Web Application 2 1

Scalable Web Application What? An application built on an architecture that can adapt to changing conditions 3 Scalable Web Application What? An application layered on an architecture that can adapt to changing conditions Why? Traffic and load patterns are unpredictable Viral or flash-mob events can result in very dynamic conditions Availability and Reliability Application must be distributed to increase likelihood of end-user accessibility Overprovision Under-utilized resources == wasted $$$ Underprovision Missed opportunities users unable to access your site/product Don t be a victim of your own success 4 2

This bed is too big. This bed is too small 5 Cloud Resource Model Dynamically provision the resources you need to meet the current demand Demand goes up, resources are added d Demand goes down, resources are removed In true utility computing fashion, only pay for what you use, when you use it 6 3

But this bed is just right 7 Scalable Web Application When? No time like the present 8 4

Scalable Web Application When? No time like the present How? Stay tuned 9 Reference Architecture 10 5

Load Balancing Tier 11 Load Balancing ELB or not ELB. That is the question. No SSL termination on the ELB (*) Can load balance at the TCP level, el but that eliminates sticky sessions for secure connections (*) (*) No longer the case as of mid-october 2010 Can scale to handle large amounts of traffic, but slow to ramp-up Only need one (RightScale has a technical white paper on load balancing solutions that can be provided if desired) 12 6

Load Balancing ELB or not ELB. That is the question. No SSL termination on the ELB (*) Can load balance at the TCP level, el but that eliminates sticky sessions for secure connections (*) (*) No longer the case as of mid-october 2010 Can scale to handle large amounts of traffic, but slow to ramp-up Only need one (RightScale has a technical white paper on load balancing solutions that can be provided if desired) HAProxy + Apache 13 Can handle SSL termination on the load balancer Allows for sticky sessions with secure connections Each instance can handle a specific amount of traffic with no ramp-up time Each instance can only handle a specific amount of traffic Addition of load balancers is possible, but requires DNS modifications Load Balancing Load Balancer + Application server Possible, and good for test and dev Not a best practice for a production environment Traffic spikes can cause instance to perform both load balancing and application functions poorly 14 7

Load Balancing Load Balancer + Application server Possible, and good for test and dev Not a best practice for a production environment Traffic spikes can cause instance to perform both load balancing and application functions poorly Recommendation: Minimum of two load balancers Each load balancer should be in a different availability zone (AZ) to increase reliability and availability RightScale testing has shown that m1.large is a good choice for load balancers Due to 100K-120K packet-per-second limit, larger instances do not provide much gain in throughput Roughly 5K responses/second can be handled by m1.large With the 5K threshold in mind, select the number of load balancers required to handle your peak traffic 15 Application Server Tier Puts the scalable in a scalable application True autoscaling a must in any dynamic/unpredictable environment 16 8

Application Server Tier Autoscaling Fully automated server launch based on autoscaling triggers No manual al intervention ention (can be challenging in certain environments, i.e. Windows) Download and install application code from common repository to ensure identical configuration of all servers in the tier 17 Application Server Tier Autoscaling Fully automated server launch based on autoscaling triggers No manual al intervention ention (can be challenging in certain environments, i.e. Windows) Download and install application code from common repository to ensure identical configuration of all servers in the tier Triggers Common CPU idle Free memory System load Custom Web server connections Application-specific metrics 18 9

Application Server Tier When to scale? Conservatively. Both up and down 19 Application Server Tier When to scale? Conservatively. Both up and down Up Allow adequate lead time for new servers to become operational Before system is negatively impacted Look for trends in activity and react early Worst that can happen: Charged for an extra instance hour 20 10

Application Server Tier When to scale? Conservatively. Both up and down Up Allow adequate lead time for new servers to become operational Before system is negatively impacted Look for trends in activity and react early Worst that can happen: Charged for an extra instance hour Down When system has been underutilized for a consistent, consecutive period of time Scale down fewer servers than in a scale-up event Again, only downside is an extra hour of instance charge Better safe than sorry 21 Application Server Tier Array considerations 22 11

Application Server Tier Array considerations Weight the array across all availability zones (not regions) Increases reliability of application NOTE: Traffic within an AZ on private IPs is free. Traffic between AZs incurs a per-gigabyte charge Traffic between regions is charged at public Internet rates 23 Application Server Tier Array considerations Weight the array across all availability zones (not regions) Increases reliability of application NOTE: Traffic within an AZ on private IPs is free. Traffic between AZs incurs a per-gigabyte charge Traffic between regions is charged at public Internet rates Set minimums and maximums appropriately Minimum can assist in cost savings in times of low usage Maximum can limit overall cost exposure 24 12

Application Server Tier Array considerations Weight the array across all availability zones (not regions) Increases reliability of application NOTE: Traffic within an AZ on private IPs is free. Traffic between AZs incurs a per-gigabyte charge Traffic between regions is charged at public Internet rates Set minimums and maximums appropriately Minimum can assist in cost savings in times of low usage Maximum can limit overall cost exposure Instance size m1.large is typically y a good choice for array-based servers in a production environment m1.smalls (and even micro instances) can be used in test and development environments Every application is different, so run load tests and benchmarks to find the optimal solution for your environment 25 Application Server Tier Array considerations Weight the array across all availability zones (not regions) Increases reliability of application NOTE: Traffic within an AZ on private IPs is free. Traffic between AZs incurs a per-gigabyte charge Traffic between regions is charged at public Internet rates Set minimums and maximums appropriately Minimum can assist in cost savings in times of low usage Maximum can limit overall cost exposure Instance size m1.large is typically y a good choice for array-based servers in a production environment m1.smalls (and even micro instances) can be used in test and development environments Every application is different, so run load tests and benchmarks to find the optimal solution for your environment Code Deployment Updated code can be pushed to all servers in an array via a single click of a button 26 13

Caching Tier Caching can dramatically decrease the load on the database Particularly in read-intensive applications Costs of caching Application complexity/modification Additional instance hours to support the cache 27 Caching Tier Best practice is to have a separate, dedicated caching tier Caching can be implemented on each application server Prevents the use of a distributed cache Local cache should only be used by the co-resident application server Application complexities Database performance degradation 28 14

Caching Tier Best practice is to have a separate, dedicated caching tier Caching can be implemented on each application server Prevents the use of a distributed cache Local cache should only be used by the co-resident application server Application complexities Database performance degradation Instance Size and Count Determine memory caching footprint Select instance size and count that spreads the load over several servers Prevents loss of entire cache if a single instance fails Distribute caching servers across AZs for reliability Overprovision if possible Provide capacity for system to grow to fully utilize cache (budget permitting) 29 Caching Tier Best practice is to have a separate, dedicated caching tier Caching can be implemented on each application server Prevents the use of a distributed cache Local cache should only be used by the co-resident application server Application complexities Database performance degradation Instance Size and Count Determine memory caching footprint Select instance size and count that spreads the load over several servers Prevents loss of entire cache if a single instance fails 30 Distribute caching servers across AZs for reliability Overprovision if possible Provide capacity for system to grow to fully utilize cache (budget permitting) Manually scaling caching servers is possible but non-trivial Involves application and database performance degradation Time To Lives (TTLs) Always set to expire 15

Caching Tier Write-intensive applications Don t see as large a performance gain as read-intensive apps Memcached can be modified to perform lazy writes of data objects to the database Data can be lost in case of caching server crash Not a recommended best practice, but can be (and has been) done Tradeoff of performance versus end-user experience 31 Caching Tier Write-intensive applications Don t see as large a performance gain as read-intensive apps Memcached can be modified to perform lazy writes of data objects to the database Data can be lost in case of caching server crash Not a recommended best practice, but can be (and has been) done Tradeoff of performance versus end-user experience Third-party providers Vendor solutions exist that allow dynamic memcached scaling 32 16

Database Tier Numerous database architecture options exist No one size fits all solution, so testing and benchmarking are critical to determine proper configuration 33 Database Tier Masters and Slave(s) Multiple Slaves if budget permits Distribute te Master and Slave(s) across AZs Always use same instance size for Master and Slaves 34 17

Database Tier Masters and Slave(s) Multiple Slaves if budget permits Distribute te Master and Slave(s) across AZs Always use same instance size for Master and Slaves Data Storage EBS volumes for data store Never use ephemeral storage for persistent data Back up Master and Slaves frequently Upload snapshots to S3 or some other persistent, redundant storage 35 Database Tier Masters and Slave(s) Multiple Slaves if budget permits Distribute te Master and Slave(s) across AZs Always use same instance size for Master and Slaves Data Storage EBS volumes for data store Never use ephemeral storage for persistent data Back up Master and Slaves frequently Upload snapshots to S3 or some other persistent, redundant storage Instance Size Varies greatly based on the nature of the application and site traffic Load testing and benchmarking can assist in identifying a reasonable initial size 36 18

Database Scaling 37 Database Scaling Vertical Grow or shrink a database server from one instance size to another 38 19

Database Scaling Vertical Grow or shrink a database server from one instance size to another Horizontal Add additional servers to spread the database load 39 Database Vertical/Horizontal Scaling Large Type A Large Type B Same quantity of larger servers Vertical Scaling Small Type A Small Type B RightScale Makes Vertical or Horizontal Scaling Easier Horizontal Scaling Small Type A Small Type B Small Type A Small Type B More servers of same types 40 20

Horizontal Database Scaling Addition of read Slaves Effective for read-intensive applications Only writes need to access the master Replication lag to slaves must be considered 41 Horizontal Database Scaling Addition of read Slaves Effective for read-intensive applications Only writes need to access the master Replication lag to slaves must be considered Effective mechanism is to use MySQL Proxy 42 21

Horizontal Database Scaling Sharding Concept is to partition the database into distinct, non-overlapping pieces Horizontal ontal slicing of the database tables into groups of rows Forethought required in setting up shards since cross-shard joins are resource intensive 43 Horizontal Database Scaling Before Sharding 44 22

Horizontal Database Scaling After Sharding 45 Horizontal Database Scaling Master-Master Two (or more) Master DBs Any Master can modify any database object Replication lag can result in database inconsistencies Poorly-designed applications can cause data object collisions and leave databases in indeterminate state Not a recommended best practice, nor supported by RightScale 46 23

Horizontal Database Scaling NoSQL solutions Many options exist SimpleDB, Cassandra, Membase, CouchDB, MongoDB, Riak, etc. Basically a Key/Value store No complex operations between data objects (no relational operations) Multiple nodes can be used to implement a distributed data store Coordinated backup and recovery can be challenging Some RightScale customers are beginning to use some NoSQL solutions in specific use cases. 47 So What s Best? 48 24

So What s Best? As is typical in many technology discussions 49 So What s Best? As is typical in many technology discussions It depends 50 25

So What s Best? As is typical in many technology discussions It depends Many scalable environments share some common underlying architecture concepts 51 So What s Best? As is typical in many technology discussions It depends Many scalable environments share some common underlying architecture concepts Every application is different. As such, there is no one size fits all 52 26

So What s Best? As is typical in many technology discussions It depends Many scalable environments share some common underlying architecture concepts Every application is different. As such, there is no one size fits all Components of a reference architecture such as this can be used as a starting point, with tweaks and modifications made per the unique characteristics of the application itself, or the load and traffic patterns it experiences 53 Scalable Web Applications Q&A RightScale.com/Conference (Presentations available next week) Conference@RightScale.com 54 RightScale.com/whitepapers 27

55 28