Sunteți pe pagina 1din 61

Module 3:

Building in the cloud


Patrick Do
Technical Trainer
AWS

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Go beyond servers and storage

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Migration and reinvention

Reinvention

Value Cloud-Native Retire


tech
debt
Foundation
Project

Time
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Improving your initial project
AWS Cloud
Instance challenges:
• Performance
S3 bucket • Scalability
(static content) • Utilization

Database challenges:
EC2 • Infrastructure management
• Patching
Internet
• Scalability
gateway Web application EBS volume
(database files)
Management challenges:
Instance store • Monitoring
(ephemeral) • Planning for failures
• Deployment

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Monitor AWS resources

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon CloudWatch?

• Monitors:
• AWS resources
• Applications running on AWS
• Collects and tracks:
• Standard metrics
• Custom metrics
• Alarms:
• Send notifications
• Automatically make changes
based on rules you define

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How CloudWatch works
CloudWatch

Supported CloudWatch SNS email


CPUUtilization alarm
AWS resource notification
StatusCheckFailed
PageViewCount
CloudWatch metrics Available
statistics Amazon
EC2 Auto
Custom Scaling
application-specific
metrics AWS Management
Console
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Statistics
consumer
Manage demand efficiently

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why scaling matters

Su M T W Th F Sa

Demand Capacity

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why scaling matters

Unused
Capacity

Su M T W Th F Sa

Demand Capacity

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why scaling matters

Over
Capacity

Su M T W Th F Sa

Demand Capacity

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why scaling matters

Amazon EC2 Auto Scaling


adjusts capacity as needed
• Scale out for spikes
• Scale in during off-peak
Su M T W Th F Sa • Replace unhealthy instances
• Pay only for what you use
Demand Capacity

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic scaling with Amazon EC2 Auto Scaling
Follow the demand curve for your applications

• Select a load metric for Max 10 Amazon EC2 Auto Scaling group
Min 2
your application Desired 6
• Set as conditional and/or instance instance instance

scheduled
• Use with CloudWatch, instance instance instance
optionally

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic scaling with Amazon EC2 Auto Scaling
Follow the demand curve for your applications

• Select a load metric for Max 10 Amazon EC2 Auto Scaling group
Min 2
your application Desired 10
6
• Set as conditional and/or instance instance instance instance instance

scheduled
• Use with CloudWatch, instance instance instance instance instance
optionally
High Demand
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Dynamic scaling with Amazon EC2 Auto Scaling
Follow the demand curve for your applications

• Select a load metric for Max 10 Amazon EC2 Auto Scaling group
Min 2
your application Desired 10
6
2
• Set as conditional and/or instance

scheduled
• Use with CloudWatch, instance
optionally

Low Demand
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fleet management with Amazon EC2 Auto Scaling
Replace impaired Amazon EC2 instances without intervention

• Monitor the health of Max 10 Amazon EC2 Auto Scaling group


running instances Min 2
Desired 10
• Replace impaired AZ1
instances automatically Instance Instance Instance Instance Instance

• Balance capacity across


Availability Zones AZ2
Instance Instance Instance Instance Instance

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fleet management with Amazon EC2 Auto Scaling
Replace impaired Amazon EC2 instances without intervention

• Monitor the health of Max 10 Amazon EC2 Auto Scaling group


running instances Min 2

• Replace impaired
instances automatically
Desired 10
AZ1
Instance Instance Instance Instance
O
Instance

• Balance capacity across


Availability Zones AZ2
Instance Instance Instance Instance
O
Instance

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Fleet management with Amazon EC2 Auto Scaling
Replace impaired Amazon EC2 instances without intervention

• Monitor the health of Max 10 Amazon EC2 Auto Scaling group


running instances
• Replace impaired
Min
Desired
2
10
AZ1 P
instances automatically Instance Instance Instance Instance

P
Instance

• Balance capacity across


Availability Zones AZ2
Instance Instance Instance Instance Instance

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Elastic Load Balancing
Automatically distribute traffic across multiple targets

High availability

Health checks Elastic Load


Balancing
SSL/TLS termination

Operational monitoring
Instance Instance Instance Instance Instance

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Application Load Balancer example
EC2 instance

/images

Application 1

/api

Application 2

/data
Application Load
Balancer Application 3

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Network Load Balancer example
EC2
AutoScaling
5442 EC2

5442 EC2

Streaming
Data Network Load 5442 EC2
Balancer

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deploy database services

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DIY vs. AWS database services

• Operating system access • Easy to set up, manage, maintain

• Need features of specific • Push-button high availability


application • Focus on performance
• Managed infrastructure

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Relational Database Service?
A database service that makes it easy to set up,
operate, and scale a relational database in the cloud
Amazon RDS Engines • Easily scalable
• Automatic software patching
• Automated backups
• Database snapshots
• Multi-AZ deployments
• Automatic host replacement
• Encryption at rest and in transit

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Aurora?

• Enterprise-class relational database

• MySQL- or PostgreSQL-compatible

• Up to 5X faster than standard MySQL databases

• Up to 3X faster than standard PostgreSQL databases

• Continuous backup to Amazon S3

• Up to 15 low-latency read replicas

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Relational vs key-value databases
Relational (SQL) Key-value (NoSQL)
Data storage Rows and columns Key-value, document, graph
Schemas Fixed Dynamic
Focused on collection of
Querying Using SQL
documents
Scalability Vertical Horizontal

{
ISBN Title Author Format ISBN: 3111111223439,
Title: “Withering
Withering Tark, Depths”,
Example 3111111223439
Depths Frank
Paperback
Author: ”Tark, Frank”,
Felton, Format: “Paperback”
3122222223439 Wily Willy eBook
Maria }

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon DynamoDB?
Fast and flexible NoSQL database service for any scale

• Fully managed

• Low-latency queries

• Fine-grained access control

• Regional and global options

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon DynamoDB use cases

• Serverless web applications

• Microservices data store

• Mobile backends

• Ad tech

• Gaming

• Internet of Things (IoT)


© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Other purpose-built database services

Amazon
Amazon Redshift Amazon Neptune
Fast, scalable data DocumentDB
MongoDB-compatible Graph database
warehouse
database

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is AWS Database Migration Service?
Migrate databases to AWS quickly and securely

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The right tool for the right job
What are my requirements?
Amazon Relational
Enterprise class relational database Database Service
(Amazon RDS)
Fast and flexible NoSQL database service for any scale Amazon DynamoDB

Operating system access or application features not


supported by AWS database services
Databases on EC2

Specific case-driven requirements (Machine learning, AWS purpose-built


data warehouse, graphs) database services
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Automate deployment

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is AWS CloudFormation?
Model and provision all your cloud infrastructure resources

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CloudFormation example
VPC (10.1.0.0/16)

Public Subnet 1
(10.1.11.0/24)

Template-file
(YAML/JSON) Web
----- -- -- --- -- ----- Internet server
-- -- --- --
----- -- -- --- -- gateway
----- -- -- --- -- Security group

CloudFormation Designer

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Putting it all together (1 of 4)

AWS Cloud

S3 bucket
(static content)

EC2
Internet
Internet
gateway Web EBS volume
application (database files)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Putting it all together (2 of 4)

AWS Cloud

S3 bucket
(static content)

EC2
Internet
Internet
gateway Web
application Amazon RDS

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Putting it all together (3 of 4)
AWS Cloud

S3 bucket
Auto Scaling group (static content)

Internet Elastic
Internet
gateway Load EC2 Instances Amazon RDS
Balancing
CloudWatch

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Putting it all together (4 of 4)
AWS Cloud

S3 bucket
Auto Scaling group (static content)

Internet Elastic
Internet
gateway Load EC2 Instances Amazon RDS
Balancing
AWS
CloudFormation CloudWatch

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How can I deploy without managing infrastructure?
Quickly deploy and manage applications with AWS Elastic Beanstalk

• Upload your application code


• The service handles:
 Resource provisioning
 Load balancing
 Automatic scaling
 Monitoring

• Support applications that scale


to serve millions of users

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Connect and share data

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenge: hybrid cloud
Network challenges: AWS Cloud Communications challenge:
• Performance • Cloud instances cannot
• Reliability Amazon EC2 Auto Scaling route to onsite servers
Clients
group

Internet
gateway
EC2 instances EBS volumes
Storage challenges:
• Duplication of data onsite/offsite
• Too much network traffic
Corporate data center • Cost inefficient

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is AWS Direct Connect?
A dedicated network connection from your premises to AWS

Reduces network costs

Creates consistent network


performance
Provides private connectivity to your
Amazon VPC

Scales easily

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Direct Connect example
AWS Direct AWS Cloud
Connect location
VPC

Content Customer AWS Virtual private


or partner Direct gateway
router/firewall
router Connect
EC2 instances
endpoint
Corporate data center

Other AWS Services


© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Route 53?
A highly available and scalable Domain Name System (DNS) web service

Register domain names

Route internet traffic to the resources for your domain

Check the health of your resources

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Routing traffic

https://sales.example.com

Amazon Route 53

VPC

ELB ELB ELB

EC2 instances

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Elastic File System (Amazon EFS)?
A scalable, elastic, cloud-native file system for Linux
Dynamic elasticity

Scalable performance

Shared file storage

Fully managed

Cost-effective

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Putting it all together
AWS Cloud

Clients Amazon EC2 Auto


Scaling group

Internet Virtual
Amazon AWS Direct Connect
gateway private
EFS
EC2 instances gateway

Amazon Route 53
Corporate data center
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deliver content faster

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenge: Media streaming service
The architecture must meet the following requirements:

Transcode
Ingest Catalog Stream
video to
encoded video video to
multiple
video metadata clients
formats

Efficient, scalable Fast data Low latency


compute resources access
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS Lambda: Run code without servers

AWS
Upload your code SERVICES
HTTP
ENDPOINTS
to AWS MOBILE APPS Lambda runs your code Pay only for the
Lambda only when triggered compute time
Set your code to trigger
from an event source you use

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Benefits of Lambda

Supports multiple programming languages


Completely automated administration
Built-in fault tolerance
Supports orchestration of multiple functions
Pay per use pricing

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lambda example: create thumbnails
AWS Cloud
1
2 3

User

Source Lambda 4
bucket
Execution
5
role
Access
policy
JSON

Target
bucket Lambda
function
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon Simple Notification Service (Amazon SNS)?

Fully managed pub/sub messaging for distributed or serverless applications

Reliably deliver messages with durability

Automatically scale your workload

Simplify your architecture

Keep messages private and secure

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon SNS overview

Amazon Simple Notification Service AWS Lambda

Message Queues

HTTP/S
Publisher SNS topics Message filters
Subscribers

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon CloudFront?

A fast, secure, and global content delivery network (CDN)

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
How CloudFront delivers content to users

www.example.com/content
Edge location

cache
S3 bucket

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What is Amazon ElastiCache?
Fully managed Redis or Memcached-compatible in-memory data store

Amazon ElastiCache for Redis


Extreme performance
Versatile in-memory data store

Fully Managed

Amazon ElastiCache for Memcached


Scalable Scalable caching tier for data-intensive apps

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Challenge: Media streaming service
AWS Cloud Video metadata

Lambda ElastiCache for Search


DynamoDB
HQ Redis

480p

Video CloudFront Ingest SNS topic Playback CloudFront Stream


360p S3 bucket Streaming
encoders S3 bucket

Audio only
AWS Lambda transcoding functions
Clients
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Key Takeaways
Amazon CloudWatch Have complete visibility of your cloud resources and applications

Elastic Load Balancing


Deploy highly available applications that scale with demand
Application Auto Scaling

AWS Database Services Run SQL or NoSQL databases without the management overhead

AWS CloudFormation Programmatically deploy repeatable infrastructure

AWS Elastic Beanstalk Deploy your application in the simplest way possible

AWS Direct Connect Provision a dedicated network connection from your premises to AWS

Amazon Route 53 Run a highly available and scalable Domain Name System (DNS) web service

AWS Lambda Run code without managing servers

Amazon CloudFront Deliver your content across a massively scaled and globally available network

© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2019, Amazon Web Services, Inc. or its affiliates. All rights reserved.

S-ar putea să vă placă și