More Related Content Similar to Design, Build, and Modernize Your Web Applications with AWS (20) Design, Build, and Modernize Your Web Applications with AWS1. © 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
2. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hello, World
Donnie Prakoso, MSc
AWS Technology Evangelist, ASEAN
@donnieprakoso
donnieprakoso
• Speak in Go and Python
• Machine Learning and Serverless
• I AWS User Groups
3. © 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 members
https://www.meetup.com/AWS-VN/
4. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BeforeWe 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
5. © 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)
6. © 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
7. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
Session 3
• AWS Lambda
• Demo
• Use Case
• Hands On
• Next Steps
8. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Session 1
Starting your Cloud Journey
with AWS
9. © 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
10. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
REVISITING THE IDEA
of
“WHY AWS”?
11. © 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
12. © 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
13. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Vietnam Customers
14. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elasticity1
15. © 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
16. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Elastic Capacity
Near 100%
utilization is
possible in the
cloud!
17. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Cost Savings2
18. © 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
19. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agility3
20. © 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
21. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Breadth and Depth of Functionalities4
22. © 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 Recognition
Sharing &
Collaboration
Exabyte-Scale
Data Migration
Text to Speech Corporate Email
Application
Migration
DatabaseMigration
Regions
Availability Zones
Points of Presence
Data Warehousing
Business Intelligence
Elasticsearch
Hadoop/Spark
Data Pipelines
Streaming Data
Collection
ETL
Streaming 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
Compute
VMs, Auto-scaling,
LoadBalancing,
Containers,Virtual
PrivateServers,
BatchComputing,
CloudFunctions,
ElasticGPUs, Edge
Computing
Storage
Object,Blocks,File,
Archivals,
Import/Export,
Exabyte-scaledata
transfer
CDN
Databases
Relational,
NoSQL, Caching,
Migration,
PostgreSQL
compatible
Networking
VPC, DX, DNS
Identity
Management
Key Management
& Storage
Monitoring
& Logs
Configuration
Compliance
Web Application
Firewall
Assessment
& Reporting
Resource &
Usage Auditing
Access Control
Account
Grouping
DDOSProtection
Support Professional
Services
Optimization
Guidance
Partner
Ecosystem
Training &
Certification Solutions Management
Account
Management
Security & Billing Reports
Personalized
Dashboard
TECHNICAL & BUSINESSSUPPORT
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 ENTERPRISEAPPS MIGRATION
APP SERVICES
INFRASTRUCTURE CORE SERVICES SECURITY & COMPLIANCE MANAGEMENT TOOLS
23. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
516
24 48
6
1
82
159
280
722
1,01
7
LAUNCHES
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 capabilities daily
24. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
And also, security.
25. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Shared Responsibility Model
26. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Go global in a minute5
28. © 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%
29. © 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
30. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Because time is valuable
31. © 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
32. © 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
33. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Because time is valuable
34. © 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
35. © 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
36. © 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
37. © 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
38. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Compute offerings
AWS Lambda
Serverless compute
platform for stateless
code execution in
response to triggers
Amazon
ECS&EKS
Container management
service for running
Docker & Kubernetes on
a managed cluster of
EC2 instances
Amazon
EC2
Virtual servers
in the cloud
39. © 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
40. © 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
41. © 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
42. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Host Server
Hypervisor
Guest 1 Guest 2 Guest n
Amazon EC2 Instances
Instancegeneration
c4.large
Instancefamily Instancesize
43. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Instance sizing
c4.8xlarge 2 - c4.4xlarge
≈
4 - c4.2xlarge
≈
8 - c4.xlarge
≈
44. © 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
Snapshots
S3 Buckets
Region
45. © 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
46. © 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
47. © 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
48. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 On-Demand Pricing
Short-term, Spiky and
unpredictable
Low cost and
flexible
Develop and test
49. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EC2 Reserved Pricing
Upfront payments to
reduce costs
Steady State Reserved Capacity
50. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reserved Instance details
Options
No upfront
Partial upfront
All upfront
Commitment Level
1 Year
3 Year
RI Marketplace
* Dependent on specific AWS Service, size/type and Region
51. © 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
52. © 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
53. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Spot Rules
Markets where the price of compute changes based on supply and
demand
You’ll never pay more than your bid.
50% Bid
of OD
75% Bid
of OD
25%
Bid
of ODYou pay the
market price
87% discount!
54. © 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
55. © 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
56. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon VPC
57. © 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
Snapshots
S3 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
58. © 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
59. © 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
60. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Notes
Classroom Environment URL
https://qwiklabs.com/
Class Name:
Introduction to Amazon EC2
61. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands On – Amazon EC2
62. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Session 2
Dynamically Scale Web
Applications with Amazon EC2
Auto Scaling
63. © 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
Serverload
Hour of day
64. © 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
Serverload
Hour of day
Capacity of 1 server
65. © 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
Serverload
Hour of day
Capacity of 1 server
Traditional capacity required
66. © 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
Serverload
Hour of day
Capacity of 1 server
Traditional capacity required
1 server for 8 hours
67. © 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
Serverload
Hour of day
Capacity of 1 server
Traditional capacity required
1 server for 8 hours 1 server for 8 hours
68. © 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
Serverload
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
69. © 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
Serverload
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
70. © 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
Serverload
Hour of day
Capacity of 1 server
Traditional capacity required
1/3rd
saving
71. © 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
Instancecount
Day of month
72. © 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
Instancecount
Day of month
Monthly
predictable
peak
processing
73. © 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
Instancecount
Day of month
Traditional capacity required
74. © 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
Instancecount
Day of month
Elastic capacity
Traditional capacity required
75. © 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
Instancecount
Day of month
75% savings
Traditional capacity required
Elastic capacity
76. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Example: 3-tier web application architecture
77. 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
78. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Compute & Networking
Autoscaling
Automatic 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
Databas
e
Analytic
s
AWS Global Infrastructure
Mobile
Services
Application Services
Security &
Identity
Compute
Managemen
t Tools
Developer
Tools
Networkin
g
Storage &
Content
Distribution
Application
s
IoT
79. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Compute & Networking
Elastic Load Balancing
Create 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
Databas
e
Analytic
s
AWS Global Infrastructure
Mobile
Services
Application Services
Security &
Identity
Compute
Managemen
t Tools
Developer
Tools
Networkin
g
Storage &
Content
Distribution
Application
s
IoT
81. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Websites & Digital Transformation
82. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
BEING IN THE CLOUD
GIVES
US THE
SCALABILITY
OF ADDING
APPLICATION
AND 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/
83. © 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
84. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
RULE BOOK FOR SCALABLE WEB
APPLICATIONS ON AWS
85. © 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
86. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service all requests1
DNS APPLICATION DATA
87. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service all requests1
DNS APPLICATION DATAREQUEST
88. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service all requests1
DNS APPLICATION DATAREQUEST
89. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service all requests1
DNS APPLICATION DATAREQUEST ╳
90. © 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
91. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service all requests1
DNS APPLICATION DATAREQUEST
92. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1
DNS APPLICATION DATAREQUEST
Region
Region
Elastic
Load
Balancer
Elastic
Load
Balancer
Availability Zone
Availability Zone
Availability Zone
Availability Zone
Elastic load balancing
Multi-availability zone
Multi-region
Service all requests
93. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
1
DNS APPLICATION DATAREQUEST
Region
Region
Elastic
Load
Balancer
Elastic
Load
Balancer
Availability Zone
Availability Zone
Availability Zone
Availability Zone
Amazon
DynamoDB
Amazon
DynamoDB
Service all requests
94. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible2
95. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
1) Chose the ‘closest’ endpoint
2
REQUEST
Amazon
Route 53
Region A Region B
96. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2
REQUEST
Amazon
Route 53
Region A Region B
16ms 92ms
Service requests as fast as possible
1) Chose the ‘closest’ endpoint
97. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2
REQUEST
Amazon
Route 53
Region A Region B
16ms 92ms
Service requests as fast as possible
1) Chose the ‘closest’ endpoint
98. © 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 possible
1) Chose the ‘closest’ endpoint
99. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
2) Offload your application servers
2
London
Paris
NY
Served from S3
/images/*
3
Served from EC2
*.php
2
Single CNAME
www.mysite.com
1
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
100. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
2) Offload your application servers
2
Without Amazon CloudFront
EC2 Instances running web and application
servers are loaded with user requests for content
assets
101. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
2) 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
Offload
Scale
Down
102. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
2) Offload your application servers
2
Offload
Scale
Down
ResponseTime
ServerLoad
ResponseTime
ServerLoad
ResponseTime
Server
Load
No CDN CDN for
Static
Content
CDN for
Static &
Dynamic
Content
103. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
3) 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
104. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
4) Single digit latencies where it matters
2
DatabaseQueryPerformance
Desired consistency & predictability
Scale
105. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service requests as fast as possible
4) Single digit latencies where it matters
2
DatabaseQueryPerformance
Desired consistency & predictability
Scale
Actual performance
degrades with scale
106. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DatabaseQueryPerformance
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 possible
4) Single digit latencies where it matters
2
107. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DatabaseQueryPerformance
Amazon DynamoDB Query Performance
Scale
Relational Database
Query Performance
Amazon
DynamoDB
Service requests as fast as possible
4) Single digit latencies where it matters
2
108. © 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 possible
4) Single digit latencies where it matters
2
aws.amazon.com/solutions/case-studies/adroll/
109. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3 Handle requests at any volume & scale
1) 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)
110. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3 Handle requests at any volume & scale
2) 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
111. © 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 & scale
2) Scale out
112. © 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 & scale
2) Scale out
113. © 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 & scale
2) Scale out
114. © 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 & scale
2) Scale out
115. © 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 & scale
2) Scale out
116. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
3 Handle requests at any volume & scale
3) 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/
117. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4 Simplify your architecture with services
Relational Database Service
Database-as-a-Service
No need to install or manage database instances
Scalable and fault tolerant configurations
DynamoDB
Provisioned 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
118. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
4 Simplify your architecture with services
Amazon SQS
Reliable, highly scalable, queue
service for storing messages as they
travel between instances
Reliable message
queuing without
additional software
Elastic MapReduce
Elastic 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
119. © 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 & management
1) Everything is programmable
120. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
5 Automate operations & management
2) Think immutable, one click-deployments
AWS CloudFormation
An 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
121. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
5 Automate operations & management
3) 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
122. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
6 Use the unique properties of the cloud
1) 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
123. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
6 Use the unique properties of the cloud
1) 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
124. © 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
125. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands On – Auto Scaling
126. © 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
127. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands On – Elastic Load
Balancer
128. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Session 3
Go Serverless! Modernize Your
Applications with AWS Lambda
129. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda – Serverless code
execution?
130. © 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
131. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda – Why use it?
132. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
No Server is Easier to Manage
Than No Server
133. © 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
134. © 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
135. © 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)
136. © 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
137. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Lambda – How do I use it?
138. © 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
139. © 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
140. © 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
141. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Lambda use case – Data processing
142. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Notes
Classroom Environment URL
https://qwiklabs.com/
Class Name:
Introduction to AWS Lambda
143. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands On – AWS Lambda
144. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Hands On – AWS Lambda
145. © 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
146. © 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
147. © 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
148. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Another View
of
Shifting Perspective
149. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Builders
Data scientist
CEO
Web Developer
Dev Ops
150. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
People who are building
for tomorrow
Builders
151. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Thank you!
For being a builder.
152. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Title Only
153. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Title + Content
154. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Code Snippet
155. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Section Title
156. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Section Title
157. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
158. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
159. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Two Content
160. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Comparison
161. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Three Content
162. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Four Content - Graphics
163. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Six Content - Graphics
164. © 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved.