Building and Managing Scalable Applications on AWS: 1 to 500K users

0 %
100 %
Information about Building and Managing Scalable Applications on AWS: 1 to 500K users
Technology

Published on February 28, 2014

Author: AmazonWebServices

Source: slideshare.net

Description

This presentation session from the Cloud Management, Services and Applications Theatre at Cloud Expo Europe 2014 explores the techniques and AWS services that you can use in order to build high scalability web applications on AWS. It also features a great overview of a high-scalability mobile application built by Myriad Group, and AWS customer, that serves over 41 million users.

Building and Managing Scalable Applications on AWS: 1 to 500K users Ian Massingham IanMmmm Technical Evangelist, Amazon Web Services Feb, 2014

WARNING: NOT A MARKETING PRESENTATION

• US: Ian Massingham – Technical Evangelist, Amazon Web Services, @IanMmmm • YOU: Here to learn more about scaling and managing applications on AWS • THIS SESSION: About best practices and things to think about when building for large scale

So how do we scale?

Some Basics

Regions& Availability Zones US West (Oregon) EU (Ireland) AWS GovCloud (US) Asia Pacific (Tokyo) US East (Virginia) Asia Pacific (Sydney) US West (N. California) South America (Sao Paulo) Asia Pacific (Singapore)

Edge Locations

Service Reference Model Deployment & Administration App Services Compute Storage & Content Delivery Database Networking AWS Global Infrastructure

AWS OpsWorks Amazon SNS Amazon CloudSearch Amazon SES Amazon SWF Amazon SQS Amazon CloudWatch AWS Elastic Beanstalk AWS IAM AWS CloudFormation Deployment & Administration AWS Data Pipeline Amazon ElastiCache Amazon DynamoDB Amazon RDS Amazon RedShift Amazon Elastic Transcoder App Services Compute Amazon EC2 Amazon EMR Storage & Content Delivery Database AWS Storage Gateway Amazon VPC Networking Amazon Route 53 Amazon S3 AWS Direct Connect AWS Global Infrastructure Amazon CloudFront Amazon Glacier

So let’s start from day one, user one ( you )

Day One, User One • A single EC2 Instance • With full stack on this host • Web app • Database • Management • Etc. • A single Elastic IP • Route53 for DNS Amazon Route 53 User Elastic IP EC2 Instance

“We’re gonna need a bigger box” • Simplest approach • Can now leverage PIOPs • High I/O instances • High memory instances • High CPU instances • High storage instances • Easy to change instance sizes • Will hit an endpoint eventually hi1.4xlarge m2.4xlarge m1.small

“We’re gonna need a bigger box” • Simplest approach • Can now leverage PIOPs • High I/O instances • High memory instances • High CPU instances • High storage instances • Easy to change instance sizes • Will hit an endpoint eventually hi1.4xlarge m2.4xlarge m1.small

Day One, User One • We could potentially get to a few hundred to a few thousand depending on application complexity and traffic • No failover • No redundancy • All our eggs in one basket Amazon Route 53 User Elastic IP EC2 Instance

Day One, User One: • We could potentially get to a few hundred to a few thousand depending on application complexity and traffic • No failover • No redundancy • All our eggs in one basket Amazon Route 53 User Elastic IP EC2 Instance

Day Two, User >1 First let’s separate out our single host into more than one. • Web • Database • Make use of a database service? Amazon Route 53 User Elastic IP EC2 Instance Database Instance

Database Options Self-managed Fully Managed Database Server on Amazon EC2 Amazon RDS Amazon DynamoDB Amazon Redshift Your choice of database running on Amazon EC2 Microsoft SQL, Oracle or MySQL as a managed service Managed NoSQL database service using SSD storage Massively parallel, petabyte-scale, data warehouse service Bring Your Own License (BYOL) Flexible licensing – BYOL or license included Seamless scalability Fast, powerful and easy to scale Zero administration

But how do I choose what DB technology I need? SQL? NoSQL? Not a binary decision!

User >100 First let’s separate out our single host into more than one • Web Amazon Route 53 User Elastic IP • Database • Use RDS to make your life easier EC2 Instance RDS DB Instance

User > 1000 User Next let’s address our lack of failover and redundancy issues Amazon Route 53 Elastic Load Balancing • Elastic Load Balancing • Another web instance • In another Availability Zone Web Instance Web Instance RDS DB Instance Active (Multi-AZ) RDS DB Instance Standby (Multi-AZ) Availability Zone Availability Zone • Enable Amazon RDS multi-AZ

Elastic Load Balancing • Create highly scalable applications Elastic Load Balancer • Distribute load across EC2 instances in multiple Availability Zones Feature Available Health checks Session stickiness Secure sockets layer Monitoring Details Load balance across instances in multiple Availability Zones Automatically checks health of instances and takes them in or out of service Route requests to the same instance Supports SSL offload from web and application servers with flexible cipher support Publishes metrics to CloudWatch

Scaling this horizontally and vertically will get us pretty far (10s-100s of thousands)

User >10 ks–100 ks Amazon Route 53 User Elastic Load Balancing Web Instance Web Instance Web Instance RDS DB Instance RDS DB Instance Read Replica Read Replica Availability Zone Web Instance RDS DB Instance Active (Multi-AZ) Web Instance Web Instance RDS DB Instance Standby (Multi-AZ) Web Instance RDS DB Instance Read Replica Availability Zone Web Instance RDS DB Instance Read Replica

This will take us pretty far honestly, but we care about performance and efficiency, so let’s clean this up a bit

Shift Some Load Around Let’s lighten the load on our web and database instances: Amazon Route 53 User Amazon CloudFront • Move static content from the web Instance to Amazon S3 and CloudFront • Move dynamic content from the Elastic Load Balancing to CloudFront • Move session/state and DB caching to ElastiCache or Amazon DynamoDB Elastic Load Balancer Amazon S3 Web Instance ElastiCache RDS DB Instance Active (Multi-AZ) Availability Zone Amazon DynamoDB

Working with S3 – Amazon Simple Storage Service • Object-based storage for the web • Supports fine grained permission control • 11 9s of durability • Ties in well with CloudFront • Good for things like: • Ties in with Amazon EMR • Static assets ( css, js, images, videos ) • Acts as a logging endpoint for Amazon S3, • Backups CloudFront, Billing • Supports encryption at transit and at rest • Reduced redundancy 1/3 cheaper • Amazon Glacier for super long term storage • Logs • Ingest of files for processing • “Infinitely scalable”

Amazon CloudFront Amazon CloudFront is a web service for scalable content delivery. CDN for Static CDN for Static & Content No CDN Dynamic Content • Cache static content at the edge for faster delivery • Helps lower load on origin infrastructure • Dynamic and static content Server Load Response Time Server Load • Low TTLs ( as short as 0 seconds ) Response Time • Custom SSL certificates Server Load • Zone apex support Response Time • Streaming video • Lower costs for origin fetches ( between Amazon 80 Volume of Data Delivered (Gbps) S3/EC2 and CloudFront ) • Optimized to work with EC2, Amazon S3, Elastic Load Balancing, and Route53 70 60 50 40 30 20 10 0 8:00 AM 9:00 10:00 11:00 12:00 1:00 AM AM AM PM PM 2:00 PM 3:00 PM 4:00 PM 5:00 PM 6:00 PM 7:00 PM 8:00 PM 9:00 PM

Shift Some Load Around Let’s lighten the load on our web and database instances • Move static content from the web instance to Amazon S3 and CloudFront • Move dynamic content from the Elastic Load Balancing to CloudFront • Move session/state and DB caching to ElastiCache or Amazon DynamoDB Amazon Route 53 User Amazon CloudFront Elastic Load Balancing Amazon S3 Web Instance ElastiCache RDS DB Instance Active (Multi-AZ) Availability Zone Amazon DynamoDB

Amazon DynamoDB • Provisioned throughput NoSQL database • Fast, predictable performance • Fully distributed, fault-tolerant Feature Details Provisioned throughput Predictable performance Dial up or down provisioned read/write capacity Average single-digit millisecond latencies from SSD-backed infrastructure architecture • Considerations for non-uniform data Strong consistency Be sure you are reading the most up to date values Fault tolerant Data replicated across Availability Zones Monitoring Secure Elastic MapReduce Integrated to CloudWatch Integrates with AWS Identity and Access Management (IAM) Integrates with Amazon Elastic MapReduce for complex analytics on large datasets

Now that our Web tier is much more lightweight, we can revisit the beginning of our talk…

Auto Scaling!

Auto Scaling Amazon CloudWatch Automatic resizing of compute clusters based on demand Trigger autoscaling 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. aws autoscaling create-autoscaling-group — Auto Scaling-group-name MyGroup — Launch-configuration-name MyConfig — Min size 4 — Max size 200 — Availability Zones us-west-2c

Typical Weekly Traffic to Amazon.com Sunday Monday Tuesday Wednesday Thursday Friday Saturday

Typical Weekly Traffic to Amazon.com Provisioned Capacity Sunday Monday Tuesday Wednesday Thursday Friday Saturday

November Traffic to Amazon.com November

November Traffic to Amazon.com Provisioned Capacity November

November Traffic to Amazon.com 76% Provisioned Capacity November 24%

November Traffic to Amazon.com November

Auto Scaling lets you do this!

User >500k+ Amazon Route 53 User Amazon Cloudfront Elastic Load Balancing Web Instance Web Instance Web Instance Amazon S3 Web Instance Web Instance Web Instance DynamoDB RDS DB Instance RDS DB Instance Active (Multi-AZ) Read Replica Availability Zone ElastiCache RDS DB Instance RDS DB Instance Standby (Multi-AZ) Read Replica Availability Zone ElastiCache

Want to go beyond 500K users? Let me introduce an AWS customer that has done that…

42

Myriad Overview Myriad delivers consumer applications, messaging solutions, and embedded software to leading OEMs, mobile operators, and pay TV providers worldwide. Messaging Services – Instant messaging to tens of millions of users in Latin America – Access to social networking applications via USSD on feature phones in Latin America, Asia and Africa – Working with some of the world’s most successful mobile phone operators. Java – Long established business providing Java VM for embedded devices Connected Home Solutions – Found in tens of millions of set-top boxes and Blu-ray players. – Driving the convergence of mobile, tablets and TV through creation of a suite of exciting connected home solutions. Worldwide operation with 200 people located in UK, France, Mexico, Brazil, India & China. 43

Myriad Messenger Latin American chat service launched in 16 markets 41M users through current carrier partnerships Service platform and clients undergoing redevelopment to support rapid growth with complementary carrier and OTT services The challenge – Build a new platform that will deliver superior performance, features and scale in a short time with a small team 44

High level platform overview user service Platform is Java addressbook service All services developed as OSGi bundles Apache Felix OSGi container WAP service OSGi allows us to separate functional interfaces from implementations dynamically – We can quickly and painlessly swap out implementations if they don’t perform or scale We have a single design pattern for all system components message service REST API servers message queue handlers message queue MSNGR clients routing service SMS aggregator message notification We have developed OSGi services over AWS 45 notification queue Amazon cloud messaging

AWS Application Services Each of our persistent services runs over DynamoDB – Gives us unlimited scale, predictable latency and the ability to individually tune the IO requirements to suit the service (e.g. address book needs less IO than message service, and greater read capacity than write) We make extensive use of SQS to decouple system components and allow us to – scale more effectively – flatten daily system usage patterns – give clients a very fast response to the REST API SNS for internal message routing Elasticache provides caches for performance (and cost reduction) over system hotspots S3 for storage of media, extended message bodies, branding packages, code deployments EC2/Cloudwatch/Auto scaling for flexible processing on demand 46

Thank You Read! • aws.amazon.com/documentation • aws.amazon.com/architecture • aws.amazon.com/start-ups Listen! • aws.amazon.com/podcast Ian Massingham IanMmmm Technical Evangelist, Amazon Web Services Feb, 2014

Add a comment

Related presentations

Related pages

Software- as- a- Service (SaaS) on AWS

1 Software- as- a- Service (SaaS) on AWS ... is an application delivery model that enables users to utilize ... building and running a highly-scalable and ...
Read more

Hosting a Web App on Amazon Web Services - AWS Documentation

Getting Started with AWS . ... Step 1: Create an Application Server; ... A web app is any software that users access through a web browser or specialized ...
Read more

Overview of AWS - Amazon Web Services

Amazon had spent over a decade and millions of dollars building and managing ... Building applications on AWS is ... you can create and manage AWS users ...
Read more

AWS Training | Instructor-Led | Developing on AWS

... reliable and scalable AWS-based applications ... Developing on AWS helps developers understand how to use the AWS SDK to ... Day 1: Building the ...
Read more

AWS User Authentication & Mobile Data Service | Amazon Cognito

SAP Run your SAP workloads and applications on AWS’s scalable ... about building and managing a ... Amazon Cognito allows you to store user ...
Read more

Scaling on AWS (Part 4) : > One Million Users — AWS ...

... and AWS application services. ... an installed mobile application can notify its users immediately by popping a ... For startups building on AWS. ...
Read more

App Engine - Platform as a Service — Google Cloud Platform

Google App Engine is a platform for building web ... for building scalable web applications and ... User Authentication Allows applications to ...
Read more

Building Mobile Apps on AWS (Featuring Amazon Cognito ...

Build powerful mobile applications using AWS Mobile Services. For the first time, we will discuss how mobile developers can leverage the new cross-platform ...
Read more