SERVERLESS ARCHITECTURES (WITH AWS INFRASTRUCTURE) Niko Kbler - - PowerPoint PPT Presentation

serverless architectures
SMART_READER_LITE
LIVE PREVIEW

SERVERLESS ARCHITECTURES (WITH AWS INFRASTRUCTURE) Niko Kbler - - PowerPoint PPT Presentation

SERVERLESS ARCHITECTURES (WITH AWS INFRASTRUCTURE) Niko Kbler Soware-Architect, Developer & Trainer niko@n-k.de www.n-k.de @dasniko | | @dasniko DISCLAIMER This is NO silver bullet, no standard, but opinionated! SERVERLESS


slide-1
SLIDE 1

ARCHITECTURES

(WITH INFRASTRUCTURE)

Niko Köbler Soware-Architect, Developer & Trainer | |

SERVERLESS

AWS

niko@n-k.de www.n-k.de @dasniko

slide-2
SLIDE 2

@dasniko

slide-3
SLIDE 3

DISCLAIMER

This is silver bullet, no standard, but opinionated! NO

slide-4
SLIDE 4

SERVERLESS

slide-5
SLIDE 5

SERVER ? WHAT

slide-6
SLIDE 6

This is what actually mean... serverless

slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9

Serverless is about the

  • f servers.

Build and run applications servers. management without thinking about

slide-10
SLIDE 10

OF COMPUTING

Physical Servers in datacenters Virtual Machines in datacenters Virtual Machines in Cloud Containers on Virtual Machines Serverless as the unit of compute

EVOLUTION

slide-11
SLIDE 11

COMPUTE

Functions are the unit of deployment and scaling. No machines, VMs, or containers visible in the programming model. Permanent storage lives elsewhere. Scales per request; Users cannot over- or under-provision capacity. Never pay for idle (no cold servers/containers or their costs). Implicitly fault-tolerant because functions can run anywhere. BYOC - Bring Your Own Code. Metrics and logging are a universal right.

SERVERLESS MANIFESTO

slide-12
SLIDE 12

Source: various AWS presentations

slide-13
SLIDE 13

?

Unit of deployment and scale!

PAAS

slide-14
SLIDE 14

PaaS FaaS

is as

DevOps NoOps vs. vs.

slide-15
SLIDE 15

AWS LAMBDA

slide-16
SLIDE 16

AWS

Event Driven JVM-based languages (Java 8), JavaScript (Node.js), Python, C#, (more to come) Versions, Encrypted Environment Variables, Step Functions Pay as you use - in 100ms blocks (e.g. 100ms w/ 128MB memory = USD 0.000000208)

LAMBDA

slide-17
SLIDE 17

AWS

EXAMPLE

LAMBDA

NODE

exports.handler = (event, context) => { console.log('Received event:', JSON.stringify(event)); }

slide-18
SLIDE 18

AWS

EXAMPLE

LAMBDA

JAVA

public class ImageProcessor implements RequestHandler<S3Event, Void> { @Override public Void handleRequest(S3Event s3Event, Context context) { // get the S3 event data from the event request S3EventNotification.S3EventNotificationRecord record = s3Event.getRecords().get(0); // your code goes here... // return an object with specified type (see class generics) return null; } }

slide-19
SLIDE 19

AWS EVENTS

S3 Cloud Watch Config AWS IoT Cognito SES API Gateway

(no complete list)

LAMBDA

DynamoDB Cloud Formation Kinesis Code Commit SNS Echo / Alexa Cron

slide-20
SLIDE 20

GATEWAY API

slide-21
SLIDE 21

GATEWAY

"Reverse Proxy" hides possible multiple service calls (aka "service composition", ESB?) distributes requests to proper service instances "Mock" services Caching, Throttling, DDoS attack protection, etc.

API

slide-22
SLIDE 22

API GATEWAY NETFLIX

slide-23
SLIDE 23
slide-24
SLIDE 24

GATEWAY

"Reverse Proxy" hides possible multiple service calls (aka "service composition", ESB?) distributes requests to proper service instances "Mock" services Caching, Throttling, DDoS attack protection, etc.

API

slide-25
SLIDE 25

GATEWAY

AUTHENTICATION / AUTHORIZATION

AWS Cognito / STS Custom Authorizer (Lambda Function, returning IAM policies)

API

slide-26
SLIDE 26

API GATEWAY AUTHORIZATION

slide-27
SLIDE 27

GATEWAY API

slide-28
SLIDE 28
slide-29
SLIDE 29

DYNAMODB

slide-30
SLIDE 30

DYNAMO

Fully Managed NoSQL Data Store Schemaless Data Model Seamless Scalabiltiy, "no limits" Pay by Read-/Write-Capacity-Units

DB

slide-31
SLIDE 31

Example

CASES USE

slide-32
SLIDE 32

SERVERLESS ARCHITECTURE WEB

slide-33
SLIDE 33

SERVERLESS ARCHITECTURE WEB

slide-34
SLIDE 34
slide-35
SLIDE 35
slide-36
SLIDE 36

API Gateway with , Push and SNS SQS

slide-37
SLIDE 37
slide-38
SLIDE 38

SKILLS BOTS (CHAT/VOICE) ALEXA

slide-39
SLIDE 39

TESTING

slide-40
SLIDE 40

TESTING

Functions are easy to test, stateless and little to no dependencies

UNIT TESTS

slide-41
SLIDE 41

TESTING

Environment, Infrastructure

  • max. 1024 of running processes/threads
  • max. 100 concurrent Lambdas per Region

no remote debugging

INTEGRATION TESTS

slide-42
SLIDE 42

COMPETITORS?

slide-43
SLIDE 43

GOOGLE CLOUD FUNCTIONS

JavaScript

COMPETITOR

slide-44
SLIDE 44

MICROSOFT AZURE FUNCTIONS

JavaScript, C#, Python, PHP

COMPETITOR

slide-45
SLIDE 45

ON ? PREMISE

slide-46
SLIDE 46

COMPETITOR

IBM BLUEMIX

Bluemix Cloud & OnPremise Open Source / Apache License v2.0 JavaScript (Node.js), Python and... Swi! Docker Support Function-Chaining

OPENWHISK

slide-47
SLIDE 47

IBM

LET'S GET STARTED

OPENWHISK

$ git clone https://github.com/openwhisk/openwhisk.git $ cd openwhisk/tools/vagrant $ vagrant up

slide-48
SLIDE 48

IBM

JAVASCRIPT EXAMPLE

Create the action in OpenWhisk Run the action Result

OPENWHISK

function main(params) { return {payload: 'Hello, ' + params.name}; } $ wsk action create hello hello.js $ wsk action invoke hello --blocking --result --param name Niko { "payload": "Hello, Niko" }

slide-49
SLIDE 49
slide-50
SLIDE 50

Overview: Documentation, Logging & Monitoring, Metrics ! (typical things for distributed environments) Cloud Provider Binding / Dependency: APIs, Portability, Costs, SLAs

DRAWBACKS

slide-51
SLIDE 51

? WANT TO START?

Give a try! Manages all the Cloud-Resources and Deployment.

CURIOUS

serverless.com

slide-52
SLIDE 52

SERVERLESS.COM

# Install serverless globally $ npm install serverless -g # Create an AWS Lamdba function in Node.js $ serverless create --template aws-nodejs # Deploy to live AWS account $ serverless deploy # Function deployed! $ http://api.amazon.com/users/update

slide-53
SLIDE 53

BUT POWERFUL

No need to run/manage Application Servers Fast results, minimal effort, minimal TTM(!) Low costs, minimal financial risk Automatic Scalabiltiy and Availability "out-of-the-box"

SERVERLESS

slide-54
SLIDE 54

THANK !

ANY ?

Slides: Niko Köbler Soware-Architect, Developer & Trainer | |

YOU

QUESTIONS

http://bit.ly/serverless-slides niko@n-k.de www.n-k.de @dasniko

slide-55
SLIDE 55

LINKS

AWS Lambda: Amazon API Gateway: Google Cloud Functions: Microso Azure Functions: IBM OpenWhisk: IBM OpenWhisk SourceCode: Serverless Framework: https://aws.amazon.com/lambda https://aws.amazon.com/api- gateway https://cloud.google.com/functions https://azure.microso.com/services/functions https://developer.ibm.com/openwhisk https://github.com/openwhisk/openwhisk http://serverless.com