event-driven (serverless) applications

36
Event-driven (Serverless) Applications Danilo Poccia AWS Technical Evangelist @danilop danilop

Upload: danilo-poccia

Post on 14-Apr-2017

442 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Event-driven (serverless) Applications

Event-driven (Serverless) Applications

Danilo PocciaAWS Technical Evangelist

@danilopdanilop

Page 2: Event-driven (serverless) Applications

2001

Page 3: Event-driven (serverless) Applications

Decentralized, two-pizza teams

Agility, autonomy, accountability, and ownership

“DevOps”

Page 4: Event-driven (serverless) Applications

You Want to BuildYour Brand New Application

Page 5: Event-driven (serverless) Applications

Application+

Data

Page 6: Event-driven (serverless) Applications

Application+

Data

Websites

Mobile Apps

Wearable

Page 7: Event-driven (serverless) Applications

Application Data

Websites

Mobile Apps

Wearable

Page 8: Event-driven (serverless) Applications

Application

Files

DB

Content +Some API Calls

API Calls

Websites

Mobile Apps

Wearable

Page 9: Event-driven (serverless) Applications

Application

Files

DB

API Calls

Websites(JavaScript

Apps)

Mobile Apps

Wearable

JavaScript

API Calls

Page 10: Event-driven (serverless) Applications

Application

Files

DB

API Calls

Websites(JavaScript

Apps)

Mobile Apps

Wearable

Services

API Calls

JavaScript

API Calls

Page 11: Event-driven (serverless) Applications

Application

Files

DB

API Calls

Websites(JavaScript

Apps)

Mobile Apps

Wearable

Services

API Calls

JavaScriptAuthentication& Authorization

Caching & Throttling

Business Logic

API Calls

Page 12: Event-driven (serverless) Applications

Application

DB

API Calls

Websites(JavaScript

Apps)

Mobile Apps

Wearable

Services

API Calls

JavaScript

Files

AmazonS3

AmazonDynamoDB

Authentication & Authorization

AmazonCognito

Business Logic

AWSLambda

Caching & Throttling

Amazon APIGatewayAPI Calls

Page 13: Event-driven (serverless) Applications

How Does It Works?

Page 14: Event-driven (serverless) Applications

X

AuthenticationProviders

End Users

User Credentials

AuthenticationToken

Amazon CognitoIdentity Broker

Identity Pool Id(Token)

Identity IdAWS Temp Credentials

(Depending onAuth / Unauth Role)

Access toAWS Services

(Including AmazonAPI Gateway)

Identity IdAWS Temp Credentials

Amazon S3

AmazonDynamoDB

AmazonMobile Analytics

Amazon CognitoSync Store

K / V

Authentication & Authorization

AmazonCognitoCheck Token

Page 15: Event-driven (serverless) Applications

X

End Users

User Credentials

AuthenticationToken

Amazon CognitoIdentity Broker

Identity Pool Id(Token)

Identity IdAWS Temp Credentials

(Depending onAuth / Unauth Role)

Access toAWS Services

(Including AmazonAPI Gateway)

Identity IdAWS Temp Credentials

Amazon S3

AmazonDynamoDB

AmazonMobile Analytics

Amazon CognitoSync Store

K / V

Custom Authentication

ServiceGet Token

Token Authentication & Authorization

AmazonCognito

Page 16: Event-driven (serverless) Applications

AmazonCloudFront

API Gateway Cache

AmazonCloudWatch

Monitoring & Logs

Endpoints onAmazon EC2 or

AWS Elastic Beanstalk

Internet

Any other publicly accessible endpoint

AWS Lambda Functions

Caching & Throttling

Amazon APIGateway

X

Access toAPI Method

Page 17: Event-driven (serverless) Applications
Page 18: Event-driven (serverless) Applications

Managed Cache to Store API Responses

Reduced Latency and DDoS Protection through Amazon CloudFront

SDK Generation for iOS, Android and JavaScript

HTTP 429 Response for API Throttling (Managed by the SDK)

Swagger Support

Request / Response Data Transformation and API Mocking

Page 19: Event-driven (serverless) Applications

Business Logic

AWSLambda

AWSLambda

Functions

AmazonAPI Gateway Amazon S3

AmazonDynamoDB

Amazon CognitoSync Store

K / VAmazonSNS

AmazonKinesis

Alexa Skills Kit (ASK)Alexa Voice Service (AVS)

HTTPSInvoke

CustomEvents

HTTPSREST

API Call

AmazonSES

AmazonSWF

AWS IoT

?

?

?

?

???

Page 20: Event-driven (serverless) Applications

Build Back-end Services that Perform at Scale

Respond Quickly to New Information

Run Your Code without Managing Infrastructure

Cost-effective and Efficient

Page 21: Event-driven (serverless) Applications

Amazon API Gateway+

AWS Lambda

Page 22: Event-driven (serverless) Applications

Resource + HTTP Verb ➔ Method

Page 23: Event-driven (serverless) Applications

Resource + HTTP Verb ➔ Method

/books + GET ➔ GetAllBooks

Page 24: Event-driven (serverless) Applications

Resource + HTTP Verb ➔ Method

/books + GET ➔ GetAllBooks

/books + POST ➔ CreateNewBook

Page 25: Event-driven (serverless) Applications

Resource + HTTP Verb ➔ Method

/books + GET ➔ GetAllBooks

/books + POST ➔ CreateNewBook

/books/{id} + GET ➔ GetBookById

/books/{id} + PUT ➔ CreateOrUpdateBookById

/books/{id} + DELETE ➔ DeleteBookById

Page 26: Event-driven (serverless) Applications

Let’s Put Everything Together

Page 27: Event-driven (serverless) Applications

Media Sharing Application

Page 28: Event-driven (serverless) Applications

λ

λ λ

AmazonAPI Gateway

λ

λ

λλ

Bucket Usage Table

Media MetadataTable

User StatTable

User Location

Table

K / V

λ

λ

λ

Amazon CognitoIdentity Broker

Amazon CognitoSync Store

AmazonSNS

AmazonKinesis

Media Bucket

LogTable

Authentication &

AuthorizationUpload Picture / VideoUpdate Bucket UsageCheck Bucket Usage

Delete “Over Quota”

Media

Send Notification to

User / Application

Extract Metadata and Write on DB

Update User StatisticsCall REST API

to Get Media Description

Upload Location Info

Update User Location

Look for Users or Media

Near Current Location

Call REST API to Get

User Info

Sync Media and User

Rating

Write History of ChangesCheck and Update

Ratings

InvokeRead

Write / Send

Page 29: Event-driven (serverless) Applications

λ

λ λ

λ

λ

λλ

λ

λ

λ

Page 30: Event-driven (serverless) Applications

Microservice Architecture

λλ λλ

λλ λλ λ

λ

Page 31: Event-driven (serverless) Applications

Choreography vs Orchestration

λλ λλ

λλ λλ λ

λ

Page 32: Event-driven (serverless) Applications

Reactive Programming

λλ λλ

λλ λλ λ

λ

Page 33: Event-driven (serverless) Applications

<demo>…

</demo>

Page 34: Event-driven (serverless) Applications

Focus on You Idea

Page 35: Event-driven (serverless) Applications

aws.amazon.com/free

Page 36: Event-driven (serverless) Applications

Event-driven (Serverless) Applications

Danilo PocciaAWS Technical Evangelist

@danilopdanilop