Slide 1

Slide 1 text

ARCHITECTURES (WITH INFRASTRUCTURE) Niko Köbler So ware-Architect, Developer & Trainer | | SERVERLESS AWS niko@n-k.de www.n-k.de @dasniko

Slide 2

Slide 2 text

@dasniko

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

SERVERLESS

Slide 5

Slide 5 text

SERVER ? WHAT

Slide 6

Slide 6 text

This is what actually mean... serverless

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

Serverless is about the of servers. Build and run applications servers. management without thinking about

Slide 10

Slide 10 text

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 text

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 text

Source: various AWS presentations

Slide 13

Slide 13 text

? Unit of deployment and scale! PAAS

Slide 14

Slide 14 text

PaaS FaaS is as DevOps NoOps vs. vs.

Slide 15

Slide 15 text

AWS LAMBDA

Slide 16

Slide 16 text

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 text

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

Slide 18

Slide 18 text

AWS EXAMPLE LAMBDA JAVA public class ImageProcessor implements RequestHandler { @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 text

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 text

GATEWAY API

Slide 21

Slide 21 text

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 text

API GATEWAY NETFLIX

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

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 text

GATEWAY AUTHENTICATION / AUTHORIZATION AWS Cognito / STS Custom Authorizer (Lambda Function, returning IAM policies) API

Slide 26

Slide 26 text

API GATEWAY AUTHORIZATION

Slide 27

Slide 27 text

GATEWAY API

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

DYNAMODB

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

Example CASES USE

Slide 32

Slide 32 text

SERVERLESS ARCHITECTURE WEB

Slide 33

Slide 33 text

SERVERLESS ARCHITECTURE WEB

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

API Gateway with , Push and SNS SQS

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

SKILLS BOTS (CHAT/VOICE) ALEXA

Slide 39

Slide 39 text

TESTING

Slide 40

Slide 40 text

TESTING Functions are easy to test, stateless and little to no dependencies UNIT TESTS

Slide 41

Slide 41 text

TESTING Environment, Infrastructure max. 1024 of running processes/threads max. 100 concurrent Lambdas per Region no remote debugging INTEGRATION TESTS

Slide 42

Slide 42 text

COMPETITORS?

Slide 43

Slide 43 text

GOOGLE CLOUD FUNCTIONS JavaScript COMPETITOR

Slide 44

Slide 44 text

MICROSOFT AZURE FUNCTIONS JavaScript, C#, Python, PHP COMPETITOR

Slide 45

Slide 45 text

ON ? PREMISE

Slide 46

Slide 46 text

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 text

IBM LET'S GET STARTED OPENWHISK $ git clone https://github.com/openwhisk/openwhisk.git $ cd openwhisk/tools/vagrant $ vagrant up

Slide 48

Slide 48 text

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 text

No content

Slide 50

Slide 50 text

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

Slide 51

Slide 51 text

? WANT TO START? Give a try! Manages all the Cloud-Resources and Deployment. CURIOUS serverless.com

Slide 52

Slide 52 text

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 text

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 text

THANK ! ANY ? Slides: Niko Köbler So ware-Architect, Developer & Trainer | | YOU QUESTIONS http://bit.ly/serverless-slides niko@n-k.de www.n-k.de @dasniko

Slide 55

Slide 55 text

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