Slide 1

Slide 1 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Module 3: Building in the cloud Darko Meszaros - Developer Advocate @darkosubotica ln/darko-mesaros twitch.tv/ruptwelve youtu.be/ruptwelve

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Migration and reinvention Project Foundation Cloud-Native Retire tech debt Reinvention Time Value

Slide 4

Slide 4 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Instance store (ephemeral) Improving your initial project EC2 Web application EBS volume (database files) AWS Cloud Instance challenges: • Performance • Scalability • Utilization Database challenges: • Infrastructure management • Patching • Scalability Internet gateway Management challenges: • Monitoring • Planning for failures • Deployment S3 bucket (static content)

Slide 5

Slide 5 text

$(whoami) • Darko Mesaroš / Darko Meszaros / Дарко Месарош • Berlin @darkosubotica ln/darko-mesaros twitch.tv/ruptwelve youtu.be/ruptwelve

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

© 2020, 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

Slide 8

Slide 8 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. How CloudWatch works CloudWatch Available statistics Statistics consumer AWS Management Console CloudWatch metrics CPUUtilization StatusCheckFailed CloudWatch alarm Supported AWS resource Custom application-specific metrics PageViewCount SNS email notification Amazon EC2 Auto Scaling

Slide 9

Slide 9 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. CloudWatch benefits Access all your metrics from a single platform Maintain visibility across your applications, infrastructure, and services Reduce mean time to resolution (MTTR) and improve total cost of ownership (TCO) Drive insights to optimize applications and operational resources Pay as you go

Slide 10

Slide 10 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Manage demand efficiently

Slide 11

Slide 11 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why scaling matters Su M T W Th F Sa Demand Capacity

Slide 12

Slide 12 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why scaling matters Su M T W Th F Sa Demand Capacity Unused Capacity

Slide 13

Slide 13 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why scaling matters Su M T W Th F Sa Demand Capacity Over Capacity

Slide 14

Slide 14 text

© 2020, 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 • Replace unhealthy instances • Pay only for what you use Su M T W Th F Sa Demand Capacity

Slide 15

Slide 15 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dynamic scaling with Amazon EC2 Auto Scaling • Select a load metric for your application • Set as conditional and/or scheduled • Use with CloudWatch, optionally instance instance instance instance instance instance Follow the demand curve for your applications Max 10 Min 2 Desired 6 Amazon EC2 Auto Scaling group

Slide 16

Slide 16 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dynamic scaling with Amazon EC2 Auto Scaling • Select a load metric for your application • Set as conditional and/or scheduled • Use with CloudWatch, optionally instance instance instance instance instance instance instance instance instance instance High Demand Max 10 Min 2 Desired 6 Max 10 Min 2 Desired 10 Amazon EC2 Auto Scaling group Follow the demand curve for your applications

Slide 17

Slide 17 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Dynamic scaling with Amazon EC2 Auto Scaling • Select a load metric for your application • Set as conditional and/or scheduled • Use with CloudWatch, optionally instance instance Low Demand Max 10 Min 2 Desired 6 Max 10 Min 2 Desired 10 Max 10 Min 2 Desired 2 Amazon EC2 Auto Scaling group Follow the demand curve for your applications

Slide 18

Slide 18 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fleet management with Amazon EC2 Auto Scaling • Monitor the health of running instances • Replace impaired instances automatically • Balance capacity across Availability Zones Instance Instance Instance Instance Instance Instance Instance Instance Instance Instance Replace impaired Amazon EC2 instances without intervention Max 10 Min 2 Desired 10 Amazon EC2 Auto Scaling group AZ1 AZ2

Slide 19

Slide 19 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fleet management with Amazon EC2 Auto Scaling • Monitor the health of running instances • Replace impaired instances automatically • Balance capacity across Availability Zones Instance Instance Instance Instance Instance Instance Instance Instance Instance Instance O O Max 10 Min 2 Desired 10 Amazon EC2 Auto Scaling group AZ1 AZ2 Replace impaired Amazon EC2 instances without intervention

Slide 20

Slide 20 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Fleet management with Amazon EC2 Auto Scaling • Monitor the health of running instances • Replace impaired instances automatically • Balance capacity across Availability Zones Instance Instance Instance Instance Instance Instance Instance Instance Instance Instance P P Max 10 Min 2 Desired 10 Amazon EC2 Auto Scaling group AZ1 AZ2 Replace impaired Amazon EC2 instances without intervention

Slide 21

Slide 21 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Elastic Load Balancing High availability Health checks SSL/TLS termination Operational monitoring Automatically distribute traffic across multiple targets Instance Instance Instance Instance Instance Elastic Load Balancing

Slide 22

Slide 22 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Application Load Balancer example Application Load Balancer EC2 instance /data /api /images Application 1 Application 2 Application 3

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. DIY vs. AWS database services • Operating system access • Need features of specific application • Easy to set up, manage, maintain • Push-button high availability • Focus on performance • Managed infrastructure

Slide 27

Slide 27 text

© 2020, 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

Slide 28

Slide 28 text

© 2020, 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

Slide 29

Slide 29 text

© 2020, 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 Querying Using SQL Focused on collection of documents Scalability Vertical Horizontal Example ISBN Title Author Format 3111111223439 Withering Depths Tark, Frank Paperback 3122222223439 Wily Willy Felton, Maria eBook { ISBN: 3111111223439, Title: “Withering Depths”, Author: ”Tark, Frank”, Format: “Paperback” }

Slide 30

Slide 30 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. • Fully managed • Low-latency queries • Fine-grained access control • Regional and global options What is Amazon DynamoDB? Fast and flexible NoSQL database service for any scale

Slide 31

Slide 31 text

© 2020, 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)

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Other purpose-built database services Amazon Redshift Fast, scalable data warehouse Amazon DocumentDB MongoDB-compatible database Amazon Neptune Graph database

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. The right tool for the right job What are my requirements? Enterprise class relational database Amazon Relational 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, data warehouse, graphs) AWS purpose-built database services

Slide 36

Slide 36 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Automate deployment

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CloudFormation example Template-file (YAML/JSON) ----- -- -- --- -- ----- -- - - --- -- ----- -- -- --- -- ----- -- -- --- -- CloudFormation Designer VPC (10.1.0.0/16) Web server Security group Internet gateway Public Subnet 1 (10.1.11.0/24)

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting it all together (1 of 4) AWS Cloud Internet gateway Internet S3 bucket (static content) EC2 Web application EBS volume (database files)

Slide 41

Slide 41 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting it all together (2 of 4) AWS Cloud Internet gateway Internet S3 bucket (static content) EC2 Web application Amazon RDS

Slide 42

Slide 42 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting it all together (3 of 4) AWS Cloud Internet gateway Internet S3 bucket (static content) Amazon RDS Elastic Load Balancing Auto Scaling group EC2 Instances CloudWatch

Slide 43

Slide 43 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting it all together (4 of 4) AWS Cloud Internet gateway Internet S3 bucket (static content) Amazon RDS Elastic Load Balancing Auto Scaling group EC2 Instances CloudWatch AWS CloudFormation

Slide 44

Slide 44 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. How can I deploy without managing infrastructure? • Upload your application code • The service handles: üResource provisioning üLoad balancing üAutomatic scaling üMonitoring • Support applications that scale to serve millions of users Quickly deploy and manage applications with AWS Elastic Beanstalk

Slide 45

Slide 45 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Elastic Beanstalk features • Wide selection of application platforms • Variety of application deployment options • Monitoring • Application health • Monitoring, logging, and tracing • Management and updates • Scaling • Customization • Compliance

Slide 46

Slide 46 text

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

Slide 47

Slide 47 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenge: hybrid cloud Amazon EC2 Auto Scaling group EC2 instances EBS volumes AWS Cloud Corporate data center Clients Internet gateway Network challenges: • Performance • Reliability Storage challenges: • Duplication of data onsite/offsite • Too much network traffic • Cost inefficient Communications challenge: • Cloud instances cannot route to onsite servers

Slide 48

Slide 48 text

© 2020, 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

Slide 49

Slide 49 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Direct Connect example Other AWS Services AWS Cloud Corporate data center VPC Virtual private gateway Content router/firewall AWS Direct Connect location Customer or partner router AWS Direct Connect endpoint EC2 instances

Slide 50

Slide 50 text

© 2020, 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

Slide 51

Slide 51 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Routing traffic Amazon Route 53 https://sales.example.com ELB EC2 instances ELB ELB VPC

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

© 2020, 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

Slide 54

Slide 54 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Putting it all together Amazon EC2 Auto Scaling group EC2 instances Amazon EFS AWS Cloud Clients Internet gateway Corporate data center Virtual private gateway AWS Direct Connect Amazon Route 53

Slide 55

Slide 55 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deliver content faster

Slide 56

Slide 56 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenge: Media streaming service Transcode video to multiple formats Ingest encoded video Catalog video metadata Stream video to clients The architecture must meet the following requirements: Efficient, scalable compute resources Fast data access Low latency

Slide 57

Slide 57 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS Lambda: Run code without servers Set your code to trigger from an event source Pay only for the compute time you use AWS SERVICES MOBILE APPS HTTP ENDPOINTS Upload your code to AWS Lambda Lambda runs your code only when triggered

Slide 58

Slide 58 text

© 2020, 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

Slide 59

Slide 59 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lambda example: create thumbnails Source bucket Target bucket 1 3 JSON Access policy Lambda function User 5 Lambda 2 AWS Cloud 4 Execution role

Slide 60

Slide 60 text

© 2020, 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

Slide 61

Slide 61 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon SNS overview SNS topics Subscribers Publisher Message filters Amazon Simple Notification Service AWS Lambda Message Queues HTTP/S

Slide 62

Slide 62 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon CloudFront? © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. A fast, secure, and global content delivery network (CDN)

Slide 63

Slide 63 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. How CloudFront delivers content to users © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. S3 bucket Edge location cache www.example.com/content

Slide 64

Slide 64 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. What is Amazon ElastiCache? Fully managed Redis or Memcached-compatible in-memory data store Extreme performance Fully Managed Scalable Amazon ElastiCache for Redis Versatile in-memory data store Amazon ElastiCache for Memcached Scalable caching tier for data-intensive apps

Slide 65

Slide 65 text

© 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved. Challenge: Media streaming service AWS Cloud Video encoders CloudFront Ingest S3 bucket SNS topic HQ 480p 360p Audio only AWS Lambda transcoding functions Playback S3 bucket Clients DynamoDB Lambda Video metadata CloudFront Streaming Stream ElastiCache for Redis Search

Slide 66

Slide 66 text

© 2020, 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 Application Auto Scaling Deploy highly available applications that scale with demand 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

Slide 67

Slide 67 text

Thank you! © 2020, Amazon Web Services, Inc. or its affiliates. All rights reserved.