+ All Categories
Home > Documents > Serverless beyond Functions - Amazon Web Services · Serverless beyond Functions. A Quick Update...

Serverless beyond Functions - Amazon Web Services · Serverless beyond Functions. A Quick Update...

Date post: 26-Jun-2018
Category:
Upload: dinhdung
View: 227 times
Download: 0 times
Share this document with a friend
61
© 2017, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Danilo Poccia, Technical Evangelist @danilop Serverless beyond Functions
Transcript

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

Danilo Poccia, Technical Evangelist

@danilop

Serverless beyond Functions

A Quick Update…

Amazon EC2 per second billing

Amazon EC2 Spot Can Now Stop and Start Your Spot Instances

A new addition to the Amazon EC2 memory-optimized X1 Instance family – x1e.32xlarge

Amazon EC2 Systems Manager Adds Raspbian OS and Raspberry Pi Support

Elastic Load Balancing: Application Load Balancer now supports load balancingto IP addresses as targets for AWS and on-premises resources

Announcing Network Load Balancer for Elastic Load Balancing

Enhancements to the AWS Lambda Console

AWS Glue now supports Filter and Map transforms

Amazon ECS Adds Support for Adding or Dropping Linux Capabilities to Containers

New

AWS Mobile Hub releases React Native starter project with helper code to GitHub

AWS IAM Policy Summaries Now Help You Identify Errors and Correct Permissions in Your IAM Policies

Amazon Aurora Enables Database Activity Monitoring with CloudWatch Logs

AWS CodePipeline now provides notifications on pipeline, stage, and action status changes

AWS CodeBuild Now Supports Building GitHub Pull Requests

AWS CloudFormation Now Provides Stack Termination Protection

New

Elasticsearch 5.5 now available on Amazon Elasticsearch Service

AWS Deep Learning AMI Now Includes Apache MXNet 0.11 and TensorFlow 1.3.0

Apache MXNet Version 0.11 Now Supports Apple Core ML and Keras

New Amazon Lex Built-in Slot Types for Phone numbers, Speed, and Weight, Available in Preview

Export your Amazon Lex chatbot to the Alexa Skills Kit

New

What’s Your Favorite One?

What is Serverless?

Lambda Function

Do whatever you want: It’s Your Code!Trigger

Lambda Function

Trigger Do whatever you want: It’s Your Code!

S3 Bucket

Amazon API Gateway

DynamoDB Table

AWS IoT Rule

Much More!

Amazon CloudWatch

Lambda Function

You can “chain” events to build Event-Driven Applications

S3 Bucket

DynamoDB Table

Lambda Function

Serverless Case Studies

PhotoVogue is an online photography platform. Launched in 2011 and part of Vogue Italia - which is owned by Condé Nast Italia - it allows upcoming

photographers to showcase their work.

The Benefits

Quicker provisioning, from days to hours 90% faster

Cut IT costs by around 30% Seamless scalability

Amazon S3

AWS Lambda

Amazon API Gateway

Amazon CloudFront

“With Amazon API Gateway and AWS Lambda, the user experience is up to 90%

faster. That's for both photographers uploading images and the editorial team

processing them.”

Marco Viganò Head of Digital Development

Serverless Case Studies

F-Secure Increases Customer Insight and Speeds Up Activation Using AWS

“We’ve shown the rest of the company that we can put our ideas into action faster and save 70% on infrastructure costs by using AWS compared to running hardware on-premises…. We’re inspiring a shift

toward the cloud, and microservices in particular,

because of these great benefits.”

Niina Ojala Service Lead

Serverless Case Studies

UK Driver and Vehicle Licensing Agency Supports Secure, Data-Driven Innovation

“We are decomposing our applications into smaller, discrete components so we can choose the most

appropriate technology”

An API-First Approach

“We stood up a working prototype in just a few days using Amazon API Gateway. The speed with which we were

able to deliver it was unprecedented”

Matt Lewis Chief Architect, Driver and Vehicle Licensing Agency

AWS Lambda

Amazon API Gateway

Serverless by Design

Serverless by Design

A visual approach to serverless development.

Event-driven.

Think. Build. Repeat.

Serverless by Design

Serverless by Design

Serverless by Design

Serverless by Design

Deploying SAM templates

aws cloudformation package--template-file template.yaml--output-template-file template-output.yaml--s3-bucket <BUCKET> --s3-prefix <PREFIX>

aws cloudformation deploy--template-file ./template-output.yaml--stack-name <STACK_NAME>--capabilities CAPABILITY_IAM

Serverless by Design

https://sbd.danilop.net

https://github.com/danilop/ServerlessByDesign

AWS SAM Local 🐿

https://github.com/awslabs/aws-sam-local

“Where” is Serverless?

Client Back End

AWS Lambda

CDNClient Back End Devices

Sensors

Actuators

AWS Lambda

Gateway

AWS Greengrass

Lambda Functions on a Raspberry Pi

AWS Greengrass

Lambda Function

AWS Snowball Edge100TB + Greengrass Core (≃ EC2 m4.4xlarge instance)

Snowball Edge Use Cases

“Snowball Edge enables us to extend the innovative capabilities of HealthSuite, our cloud-enabled connected health ecosystem of devices, applications and digital tools supported by AWS, even when there is no network support.”

Embedded Applications

—Dale Wiggins, Business Leader, HealthSuite digital platform,

Philips

Snowball Edge Use Cases

“With AWS Snowball Edge, we can now collect 100 TB of data with no intermediate steps, and we can also analyze the images immediately using the onboard compute capabilities.”

Remote Locations for data collection and analysis

— Bob Cowen, Director of Hatfield Marine Research Center,

Oregon State University

AWS Lambda@Edge

Customize content delivery while reducing load on the origin

Events / Triggers

Take serverless to your users

Lambda@Edge Use Cases

Demo build of a CloudFront+S3 distribution,

using Lambda@Edge to secure its HTTP headers

Lambda@Edge Use Cases

These processes include applying transactional labels to purchases so

Blockbuster can track customer activity, and providing personalized recommendations

based on previous purchases.

Blockbuster runs serverless compute processes across AWS Regions and

Amazon CloudFront edge locations (using Lambda@Edge) without provisioning or

managing servers.

Let’s build a Web Chat…

Web Browser

Web Browser

CloudFront Edge Location

S3 Bucket

HTTPS

Static Content (HTML, CSS, JS)

Web Browser

CloudFront Edge Location

S3 Bucket

HTTPS

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

HTTPS Dynamic Content

Database Access

Execute Functions

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Let’s make it more interactive…

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Execute Functions

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s) AWS IoT

Rule(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Subscribe

Republish

Execute Functions

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s) AWS IoT

Rule(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Subscribe

Republish

Execute Functions

Execute Functions

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Publish

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s) AWS IoT

Rule(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Subscribe

Republish

Execute Functions

Write to DynamoDB

Execute Functions

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Publish

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s) AWS IoT

Rule(s)

Kinesis Stream(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Subscribe

Republish

Execute Functions

Streaming Data

Write to DynamoDB

Execute Functions

Execute Functions

(Micro-Batches)

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Publish

Web Browser

CloudFront Edge Location

S3 Bucket

Amazon API Gateway

Lambda Function(s)

DynamoDB Table(s)

AWS IoT Topic(s) AWS IoT

Rule(s)

Kinesis Stream(s)

HTTPS Dynamic Content

Database Access

MQTT over Secure WebSockets (Publish, Subscribe)

Subscribe

Republish

Execute Functions

Streaming Data

Write to DynamoDB

Execute Functions

Execute Functions

(Micro-Batches)

Amazon Cognito

Authentication (AWS Temporary

Credentials)Static Content

(HTML, CSS, JS)

Publish

What about Topics & Rules?

Web Browser

AWS IoT Topics

chat/in/${iot:ClientId}

chat/out

chat/pub/${room}

chat/stream

$aws/events/#

Each client has a secure “input” topic to receive content from the back end

All client can publish on an “output” topic, they are recognizable by their clientId

All client can subscribe and receive from “public” topics

Another “output” topic optimized for high volumes

AWS IoT Lifecycle Events

Web Browser

AWS IoT Topics

AWS IoT Rules

chat/in/${iot:ClientId}

chat/out

chat/pub/${room}

chat/stream

$aws/events/#

Each client has a secure “input” topic to receive content from the back end

All client can publish on an “output” topic, they are recognizable by their clientId

All client can subscribe and receive from “public” topics

Another “output” topic optimized for high volumes

AWS IoT Lifecycle Events

Lambda function to process important messages, such as a new client connection

Republish rule to send messages to the corresponding room public topic

Lambda function to process high volume dreaming data

Kinesis Stream to manage high volume streaming data

Lambda function to process AWS IoT Lifecycle Events

Store all messages in a database, to be sent to the client on connection

Web Browser

AWS IoT Topics

AWS IoT Rules

chat/in/${iot:ClientId}

chat/out

chat/pub/${room}

chat/stream

$aws/events/#

Each client has a secure “input” topic to receive content from the back end

All client can publish on an “output” topic, they are recognizable by their clientId

All client can subscribe and receive from “public” topics

Another “output” topic optimized for high volumes

AWS IoT Lifecycle Events

Lambda function to process important messages, such as a new client connection

Republish rule to send messages to the corresponding room public topic

Lambda function to process high volume dreaming data

Kinesis Stream to manage high volume streaming data

Lambda function to process AWS IoT Lifecycle Events

Store all messages in a database, to be sent to the client on connection

You can use this topic to inject JavaScript code

in the browser

So how does the flow look like?

Demo

https://chat.danilop.net/HelloDublin

Code

https://github.com/danilop/serverless-chat

More Info

http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html

http://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html

http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/DynamoDB/DocumentClient.html

What is Serverless?

“Build and run applications

without thinking about servers”

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

Danilo Poccia, Technical Evangelist

@danilop

Serverless beyond Functions


Recommended