164
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Design, Build, and Modernize Your Web Applications with AWS AWS Workshop Series 13 March 2018 Saigon, Vietnam WiFi: SSID: AWS Password: AWS@2018

Design, Build, and Modernize Your Web Applications with AWS+Build,+an… · • Tiki.vn is the fastest-growing retail company ... transfer CDN Databases Relational, NoSQL, ... AWS

Embed Size (px)

Citation preview

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Design, Build, and Modernize

Your Web Applications with

AWS

AWS Workshop Series

13 March 2018

Saigon, Vietnam WiFi:

SSID: AWS

Password: AWS@2018

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS User Group Vietnam

https://www.facebook.com/groups/awsvn/

5,275 members

494 membershttps://www.meetup.com/AWS-VN/

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Before We Start

• Take notes – a lot of it

• Ask our expert team

• Create a Qwik Labs account

• https://amazon.qwiklabs.com/

• WiFi:

• SSID: AWS

• Password: AWS@2018

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Agenda

Session 1• Cloud Computing

• Why AWS?

• AWS Core Components

• Amazon EC2

• Use Cases

• Hands On

• Amazon VPC (Optional)

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Agenda

Session 2• Quick recap on Amazon EC2

• Amazon EC2 Auto Scaling

• Amazon Elastic Load Balancing

• Use Case

• Hands On Auto Scaling

• Hands On ELB

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Agenda

Session 3• AWS Lambda

• Demo

• Use Case

• Hands On

• Next Steps

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Session 1

Starting your Cloud Journey

with AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

WHAT IS CLOUD COMPUTING?

On-demand delivery of IT resources

via the Internet

with pay-as-you-go pricing

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

REVISITING THE IDEA

of

“WHY AWS”?

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Problem Statement: • VietJet Air is an international low-cost airline from

Vietnam with robust growth.

• Mobile web site of VietJet is growing fast and requires a

scalable infrastructure.

Solution: • Auto-scaling architecture with AWS AutoScaling Group

and Load Balancer

• Dedicated connection (Direct Connect) between local

datacenter and AWS to improve quality of services for

Vietnamese customers.

Business Benefits:• Highly available and scalable mobile web site that can

serve customers all over Viet Nam and in region.

Business Critical Applications

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Problem Statement: • Tiki.vn is the fastest-growing retail company

in Vietnam and is well-positioned to be an

industry winner.

• To support their growth, Tiki is migrating

many business critical applications from on-

prem to AWS.

Solution: • Auto-scaling architecture with AWS

AutoScaling Group and Load Balancer

• Dedicated connection (Direct Connect)

between local datacenter and AWS to

guarantee performance of cloud applications.

Business Benefits:• Highly available and scalable ecommerce

applications that can support growth during

peak seasons.

Scalability while staying local

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Vietnam Customers

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Elasticity1

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Elastic Capacity

Up front Capital Expenditure = More risk

• Risk of wasted capacity

• Over-provisioning

• Risk of unavailability

• Under-Provisioning

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Elastic Capacity

Near 100%

utilization is

possible in the

cloud!

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Cost Savings2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Cost Savings

Replace Costly IT budget with Utility model

Pay as you go, only for what you use

Prevent Overspending

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Agility3

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Increase Your Business Agility

Cloud-readiness: Fit the infrastructure to the app,

or fit the app to the infrastructure

Increase Test-Dev Opportunities

Take ideas to market faster

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Breadth and Depth of Functionalities4

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Most robust, fully featured technology infrastructure platform

Integrated Networking

Rules Engine

Device Shadows

Device SDKs

Device Gateway

Registry

Local Compute

Machine Learning

Conversational Interface

Virtual Desktops

App Streaming

Schema Conversion

Image RecognitionSharing & Collaboration

Exabyte-ScaleData Migration

Text to Speech Corporate EmailApplication Migration

Database Migration

Regions

Availability Zones

Points of Presence

Data Warehousing

Business Intelligence

Elasticsearch

Hadoop/Spark

Data Pipelines

Streaming Data Collection

ETLStreaming Data Analysis

Interactive SQL Queries

Queuing & Notifications

Workflow

Email

Transcoding

Deep Learning Frameworks

Server Migration

Communications

Business Apps Business Intelligence DevOps Tools Security Networking StorageDatabases

API Gateway

Single Integrated Console

Identity

Sync

Mobile Analytics

Mobile App Testing

Targeted Push Notifications

One-click App Deployment

DevOps Resource Management

Application Lifecycle Management

Containers

Triggers

Resource Templates

Build and Test

Analyze and Debug

ComputeVMs, Auto-scaling, Load Balancing, Containers, Virtual Private Servers, Batch Computing, Cloud Functions, Elastic GPUs, Edge Computing

StorageObject, Blocks, File, Archivals, Import/Export, Exabyte-scale data transfer

CDN

DatabasesRelational, NoSQL, Caching, Migration, PostgreSQL compatible

NetworkingVPC, DX, DNS

Identity Management

Key Management & Storage

Monitoring & Logs

Configuration Compliance

Web Application Firewall

Assessment& Reporting

Resource & Usage Auditing

Access Control

Account Grouping

DDOS Protection

Support ProfessionalServices

Optimization Guidance

PartnerEcosystem

Training & Certification Solutions Management

Account Management

Security & Billing ReportsPersonalized Dashboard

TECHNICAL & BUSINESS SUPPORT

MARKETPLACE

Monitoring

Manage Resources

Data Integration

Integrated Identity & Access

Integrated Resource & Deployment Management

Integrated Devices& Edge Systems

Resource Templates

Configuration Tracking

Server Management

Service Catalogue

Search

HYBRID ARCHITECTUREANALYTICS MOBILE SERVICESDEV/OPS IoT AI ENTERPRISE APPS MIGRATION

APP SERVICES

INFRASTRUCTURE CORE SERVICES SECURITY & COMPLIANCE MANAGEMENT TOOLS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

516

24 4861

82159

280

722

1 ,017

LA

UN

CH

ES

2 0 0 8 2 0 0 9 2 0 1 0 2 0 1 1 2 0 1 2 2 0 1 3 2 0 1 4 2 0 1 5 2 0 1 6

1 ,300+

2 0 1 7

P A C E O F I N N O V A T I O N

New capabi l i t ies dai ly

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

And also, security.

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Shared Responsibility Model

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Go global in a minute5

A WS

REGIONAL EXPANSION

18 Regions 54 AZs, 100+ edge

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

STATE OF THE CLOUD

44.1%

7.7%

3.0

%

2.3%

1.0%

1.4%

0 .7%

2.2%

0 .5%

0.9%

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

1

2

3

4

5

Agility

Cost Savings

Breadth and Depth of Functionalities

Elasticity

Go global in a minute

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Because time is valuable

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Problem Statement: • VTV Go is the official OTT app of Viet Nam Television

(VTV) that provides 9 channels of VTV 24/7 to millions

of customers in Viet Nam and abroad.

• VTV Go streaming services must be available during

peak hours.

Solution: • Auto-scaling and Auto-healing architecture with AWS

AutoScaling Group and Load Balancer

• Dynamic scaling of cloud-based resources manages

spikes in processing demand

Business Benefits:• Flexibility to scale up or down and pay only for

resources used

• Ensure all content is available on all devices for

customers in Viet Nam and abroad.

Media Solution: VTV Go

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Problem Statement: • Ticketbox is a fast growing online registration ticketing

platform for Events, Concerts and Sports, with

businesses in Viet Nam, Thailand and Singapore.

• To support their regional expansion plan, Ticketbox

needs a cloud infrastructure that provides scalability

and availability.

Solution: • Auto-scaling architecture with AWS AutoScaling Group

and Load Balancer

• Managed database by Amazon RDS with Multi-AZ

ensures high availability.

Business Benefits:• Highly available but localized web applications

supports operations in 3 countries.

Regional expansion

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Because time is valuable

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Core Components

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Core Components

Amazon

EC2

Auto

Scaling

• Elastic Compute Cloud

• Allow users to use virtual machines per their

requirement

• Configuration options to scale up and down

• On demand compute power

• Allows to scale Amazon EC2 instance up and

down automatically per instructions set by user

• Effective for applications that fluctuate on hourly,

daily or weekly usage

• Conditions can be based off of traffic schedule

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Core Components

Elastic

Load

Balancing

• Automatically distributes

incoming traffic across multiple

EC2 in multiple availability

zones

• Serves as a single point of

contact for clients, which

increases the availability of the

application

Amazon

S3

• Scalable, high-speed, low cost,

web based service for online

backup and archiving of data

and application program

• Allows to upload, store

download any type of files up

to 5GB in size

CloudFront

• CloudFront is a CDN. It retrieves data from Amazon S3 bucket and distribute it

to multiple data center locations

• It delivers data through a network of data centers called edge locations

• The nearest edge location routed when user requests fro data, resulting in

lowest latency, low network traffic, fast access to data

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon

Route 53

Amazon

RDS

AWS Core Components

• Highly available and scalable Domain Name

System (DNS) web service.

• Designed for developers and corporates to

route the end users to internet application

• Connects user requests to infrastructure

running in AWS – such as Amazon EC2

instances, Elastic Load Balancing load

balancers, or Amazon S3 buckets

• Fully managed SQL database cloud service

• Allows to create and operate relational

database

• Using RDS to access files and database

anywhere in cost effective and highly scalable

way

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Compute offerings

AWS LambdaServerless compute

platform for stateless

code execution in

response to triggers

Amazon

ECS&EKSContainer management

service for running

Docker & Kubernetes on

a managed cluster of

EC2 instances

Amazon

EC2Virtual servers

in the cloud

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Compute Offerings

• VMs

• Machine as the unit of scale

• Abstracts the hardware

• Containers

• Application as the unit of scale

• Abstracts the OS

• Serverless

• Functions as the unit of scale

• Abstracts the language runtime

Amazon ECS

Amazon EKS

Amazon EC2

AWS Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

How do I choose?

• VMs

• “I want to configure machines,

storage, networking, and my OS”

• Containers

• “I want to run servers, configure

applications, and control scaling”

• Serverless

• “Run my code when it’s needed”

ECS

EC2

Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

What is EC2?

aws ec2 run-instances \--image-id ami-a10897d6 \--instance-type c4.8xlarge \--count 1000 \--security-group-ids sg-0ba94d6e \--key-name MyKeyPair

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Host Server

Hypervisor

Guest 1 Guest 2 Guest n

Amazon EC2 Instances

Instance generation

c4.largeInstance family Instance size

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Instance sizing

c4.8xlarge 2 - c4.4xlarge

4 - c4.2xlarge

8 - c4.xlarge

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 Terminology

AMI

Virtual Machine

Configuration

Instance

Running or

Stopped VM

VPC

AZ Availability Zone

Amazon S3

EBS EBS EBS

VPC

EBS EBS EBS

EBS

SnapshotsS3 Buckets

Region

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 Instance Families

Compute Optimized: C family

• Lowest price for compute performance

Memory Optimized: R and X families

• Lowest price per GiB of RAM

Storage optimized: I and D families

• Best value for IO performance or per GB instance storage

General purpose: M and T families

• Balance of compute, memory, and network resources

Accelerated Computing: F, G and P families

• Ideal for graphics and general purpose GPU compute applications

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 Security Groups

Security Group Rules• Name

• Description

• Protocol

• Port range

• IP address, IP range,

Security Group name

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

On-Demand

Pay for compute capacity by the hour with no long-term commitments

For spiky workloads, or to define needs

Reserved

Make a low, one-time payment and receive a significant discount on the hourly charge

For committed utilization

Spot

Bid for unused capacity, charged at a Spot Price which fluctuates based on supply and demand

For time-insensitive or transient workloads

Dedicated

Launch instances within Amazon VPC that run on hardware dedicated to a single customer

For BYOL and highly sensitive/regulated workloads

Use a purchasing option (mix) that best fits your workload

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 On-Demand Pricing

Short-term, Spiky and

unpredictable

Low cost and

flexibleDevelop and test

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 Reserved Pricing

Upfront payments to

reduce costs

Steady State Reserved Capacity

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Reserved Instance details

OptionsNo upfront

Partial upfront

All upfront

Commitment Level

1 Year

3 Year

RI Marketplace

* Dependent on specific AWS Service, size/type and Region

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

EC2 Spot Pricing

Users with urgent

computing needs or

large amounts of

additional capacity

Time or instance

flexible

Experiment and/or

build cost sensitive

businesses

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Spot Instance details

Options• Spot fleet to maintain Instance

Availability

• Spot block durations (1-6

hours) for workloads that must

run continuously

Commitment level

• None

* Compared to On Demand price based on specific EC2 instance type, region and availability zone

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Spot RulesMarkets where the price of compute changes based on supply and

demand

You’ll never pay more than your bid.

50% Bidof OD

75% Bid of OD

25% Bidof OD

You pay the market price87% discount!

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

“By using AWS Spot instances, we've been able to save 75% a

month simply by changing four lines of code. It makes perfect

sense for saving money when you're running continuous

integration workloads or pipeline processing.”

Matthew Leventi, Lead Engineer, Lyft

Why use Spot – customer examples

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Use a Combination of All Three!

1. Use Reserved Instances for

known/steady-state workloads

2. Set-up multiple Scaling groups

3. Scale using Spot, On-Demand or

both

0

2

4

6

8

10

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

/Spot

On Demand

Spot

Reserved Instance

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon VPC

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

VPC

AZ Availability Zone

Amazon S3

EBS EBS EBS

VPC

EBS EBS EBS

EBS

SnapshotsS3 Buckets

Region

• Amazon VPC is the networking

layer for Amazon EC2

• Virtual Private Cloud (VPC) is a

virtual network dedicated to your

AWS account

• Isolated with other virtual networks

• Public subnet or private subnet

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Build secure architectures

Use VPC - Provision a logically isolated section of the AWS cloud

Control your virtual networking environment with:

• Subnets

• Route tables

• Security groups

• Network ACLs

• Flow logging (new!)

Control if and how your instances access the Internet

Connect to your on-premises network via a hardware VPN or AWS Direct Connect

Monitor all changes via Amazon CloudWatch Logs and AWS CloudTrail

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Availability Zone 1a Availability Zone 1b

Internet

10.0.0.5

10.0.0.6

10.0.3.17

10.0.3.5

10.0.1.5

10.0.1.25

10.0.1.8

10.0.1.6

VPC Subnet

VPC Subnet

VPC Subnet

Virtual Private Gateway

Customer Gateway

VPN Connection

Internet Gateway

Customer Data Center

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Notes

Classroom Environment URL

https://qwiklabs.com/

Class Name:

Introduction to Amazon EC2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Hands On – Amazon EC2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Session 2

Dynamically Scale Web

Applications with Amazon EC2

Auto Scaling

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

1 server for 8 hours

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

1 server for 8 hours 1 server for 8 hours

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

1 server for 8 hours 1 server for 8 hours

1 server for 8 hours

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

1 server for 8 hours 1 server for 8 hours

1 server for 8 hours

1 server for 8 hours

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

Serv

er

load

Hour of day

Capacity of 1 server

Traditional capacity required

1/3rd

saving

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

Insta

nce c

ou

nt

Day of month

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

Insta

nce c

ou

nt

Day of month

Monthly

predictable

peak

processing

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

Insta

nce c

ou

nt

Day of month

Traditional capacity required

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

Insta

nce c

ou

nt

Day of month

Elastic capacity

Traditional capacity required

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

0

1

2

3

4

5

6

0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30

Insta

nce c

ou

nt

Day of month

75% savings

Traditional capacity required

Elastic capacity

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Example: 3-tier web application architecture

Scalable Web Apps

A very popular use-case for AWS services

Applications with growing, variable or cyclical demand fit AWS well

Elasticity and automation can be exercised to real advantage

AWS services allow you to accelerate application development

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Compute & Networking

AutoscalingAutomatic re-sizing of compute clusters based

upon demand.

Trigger auto-scaling policy

Feature Details

Control Define minimum and maximum instance pool sizes

and when scaling and cool down occurs

Integrated to

CloudWatch

Use metrics gathered by CloudWatch to drive

scaling

Instance types Run auto scaling for on-demand instances and spot.

Compatible with VPC

Actual

EC2

91

Database

Analytics

AWS Global Infrastructure

Mobile Services

Application Services

Security & Identity

Compute

Management Tools

Developer Tools

Networking

Storage & Content

Distribution

Applications

IoT

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Compute & Networking

Elastic Load BalancingCreate highly scalable applications.

Distribute load across EC2 instances in multiple availability zones.

Feature Details

Auto-scaling Automatically scales to handle request volume

Available Load balance across instances in multiple

availability zones

Health checks Automatically checks health of instances and

takes them in or out of service

Session stickiness Route requests to the same instance

Secure sockets layer Supports SSL offload from web and application

servers with flexible cipher support

Monitoring Publishes metrics to Cloud Watch

92

Database

Analytics

AWS Global Infrastructure

Mobile Services

Application Services

Security & Identity

Compute

Management Tools

Developer Tools

Networking

Storage & Content

Distribution

Applications

IoT

WHY AWS FOR SCALABLE

WEB APPLICATIONS?

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Websites & Digital Transformation

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

BEING IN THE CLOUD GIVES

US THE

SCALABILITYOF ADDING

APPLICATIONAND 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/

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

RULE BOOK FOR SCALABLE WEB

APPLICATIONS ON AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATA

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATAREQUEST

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATAREQUEST

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATAREQUEST ╳

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATAREQUEST

100%

Availability

SLA

aws.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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service all requests1

DNS APPLICATION DATAREQUEST

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible1) Chose the ‘closest’ endpoint

2

REQUESTAmazon

Route 53

Region A Region B

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

2

REQUESTAmazon

Route 53

Region A Region B

16ms 92ms

Service requests as fast as possible1) Chose the ‘closest’ endpoint

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

2

REQUESTAmazon

Route 53

Region A Region B

16ms 92ms

Service requests as fast as possible1) Chose the ‘closest’ endpoint

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

2

Amazon

Route 53

Region A Region B

16ms

REGION A DNS ENTRY

REQUEST

Service requests as fast as possible1) Chose the ‘closest’ endpoint

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible2) Offload your application servers

2

London

Paris

NY

Served from S3

/images/*3

Served from EC2

*.php2

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible2) Offload your application servers

2

Without Amazon CloudFront

EC2 Instances running web and application

servers are loaded with user requests for content

assets

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible2) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible2) Offload your application servers

2

OffloadScale

Down

Re

spo

nse

Tim

e

Se

rve

r L

oa

d

Re

spo

nse

Tim

e

Serv

er

Load

Re

spo

nse

Tim

e

Se

rve

r

Load

No CDN CDN for

Static

Content

CDN for

Static &

Dynamic

Content

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible3) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible4) Single digit latencies where it matters

2D

ata

ba

se Q

uery

Pe

rfo

rma

nce

Desired consistency & predictability

Scale

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Service requests as fast as possible4) Single digit latencies where it matters

2D

ata

ba

se Q

uery

Pe

rfo

rma

nce

Desired consistency & predictability

Scale

Actual performance

degrades with scale

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Da

tab

ase Q

uery

Pe

rfo

rma

nce

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 possible4) Single digit latencies where it matters

2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Da

tab

ase Q

uery

Pe

rfo

rma

nce

Amazon DynamoDB Query Performance

Scale

Relational Database

Query Performance

Amazon

DynamoDB

Service requests as fast as possible4) Single digit latencies where it matters

2

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 possible4) Single digit latencies where it matters

2

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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

3 Handle requests at any volume & scale1) 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)

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

3 Handle requests at any volume & scale2) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & scale2) Scale out

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & scale2) Scale out

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & scale2) Scale out

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & scale2) Scale out

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & scale2) Scale out

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

3 Handle requests at any volume & scale3) 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/

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

4 Simplify your architecture with services

Relational Database ServiceDatabase-as-a-Service

No need to install or manage database instances

Scalable and fault tolerant configurations

DynamoDBProvisioned 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

4 Simplify your architecture with services

Amazon SQSReliable, highly scalable, queue

service for storing messages as they

travel between instances

Reliable message

queuing without

additional software

Elastic MapReduceElastic 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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 & management1) Everything is programmable

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

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

AWS CloudFormationAn 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

5 Automate operations & management3) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

6 Use the unique properties of the cloud1) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

6 Use the unique properties of the cloud1) 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

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Notes

Classroom Environment URL

https://qwiklabs.com/

Class Name:

Introduction to Amazon EC2

Auto Scaling

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Hands On – Auto Scaling

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Notes

Classroom Environment URL

https://qwiklabs.com/

Class Name:

Introduction to Elastic Load

Balancing

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Hands On – Elastic Load

Balancer

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Session 3

Go Serverless! Modernize Your

Applications with AWS Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Lambda – Serverless code

execution?

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

High performance at any scale;

Cost-effective and efficient

No Infrastructure to manage

Pay only for what you use: Lambda

automatically matches capacity to

your request rate. Purchase

compute in 100ms increments.

Bring Your Own Code

Stateless, trigger-based code execution

Run code in a choice of standard

languages. Use threads, processes,

files, and shell scripts normally.

Focus on business logic, not

infrastructure. You upload code; AWS

Lambda handles everything else.

AWS Lambda Functions

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Lambda – Why use it?

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

No Server is Easier to Manage

Than No Server

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Architect to be Serverless

Fully managed

• No provisioning

• Zero administration

• High availability

Developer productivity

• Focus on the code that

matters

• Innovate rapidly

• Reduce time to market

Continuous scaling

• Automatically

• Scale up and scale down

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Components of Lambda

• A Lambda function (that you write)

• An event source

• The AWS Lambda service

• The function networking environment

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Event Sources

• When should your function

execute?

• Many AWS services can be

an event source today:

• Amazon S3

• Amazon Kinesis

• Amazon SNS

• Amazon DynamoDB

• Amazon CloudWatch

• AWS Config Rules

• Amazon Echo

• Etc.

• …and Amazon API

Gateway (more later)

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

What’s Unique About Lambda?

Abstraction at the code/function level (arbitrary, flexible,

familiar)

The security model (IAM, VPC)

The pricing model

The community

Integration with the AWS service ecosystem!

• Scale

• Triggers

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Lambda – How do I use it?

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Key Lambda scenarios

Data processing

Stateless processing of

discrete or streaming

updates to your data-

store or message bus

Control systems

Customize responses

and response workflows

to state and data

changes within AWS

App backend

development

Execute server side

backend logic in a cross

platform fashion

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Amazon API Gateway: Serverless APIs

Internet

Mobile

apps

Websites

Partner

Services

AWS Lambda

functions

API

Gateway

response

cache

Endpoints on

Amazon EC2

Any publicly

accessible

endpoint

Amazon

CloudWatch

Amazon

CloudFront

API

Gateway

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Serverless Website

AWS Lambda

function

web browser

Amazon S3

Dynamic content

Amazon API

Gateway

Static content

Amazon

DynamoDB

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Lambda use case – Data processing

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Notes

Classroom Environment URL

https://qwiklabs.com/

Class Name:

Introduction to AWS Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Hands On – AWS Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Hands On – AWS Lambda

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Your

Business

70%

Infrastructure

that you own

& operate

30%

Managing All of the

“Undifferentiated Heavy Lifting”

Simplify your architecture with AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Your

Business

70%

Infrastructure

that you own

& operate

30%

Managing All of the

“Undifferentiated Heavy Lifting”

AWS

Cloud-Based

Infrastructure

More Time to Focus on

Your Business

Configuring Your

Cloud Services

30%70%

Simplify your architecture with AWS

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

AWS Activate | Builders

Benefits

• $1,000 AWS Promotional Credit, valid up to 2 years

• AWS Business Essentials Online Training ($600 value)

• AWS Technical Essentials Online Training ($600 value)

• 80 credits for self-paced labs ($80 value)

http://bit.ly/AWSActivateBuilders

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Another View

of

Shifting Perspective

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Builders

Data scientist

CEO

Web Developer

Dev Ops

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

People who are building

for tomorrow

Builders

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Thank you!

For being a builder.

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Title Only

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Title + Content

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Code Snippet

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Section Title

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Section Title

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Two Content

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Comparison

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Three Content

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Four Content - Graphics

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.

Six Content - Graphics

© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.