serverless architectures
play

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


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

  2. @dasniko

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

  4. SERVERLESS

  5. SERVER WHAT ?

  6. This is what actually mean... serverless

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

  8. EVOLUTION OF COMPUTING Physical Servers in datacenters Virtual Machines in datacenters Virtual Machines in Cloud Containers on Virtual Machines Serverless as the unit of compute

  9. SERVERLESS COMPUTE MANIFESTO 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.

  10. Source: various AWS presentations

  11. PAAS ? Unit of deployment and scale!

  12. PaaS vs. FaaS is as DevOps vs. NoOps

  13. AWS LAMBDA

  14. AWS LAMBDA 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)

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

  16. AWS LAMBDA JAVA EXAMPLE 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; } }

  17. AWS LAMBDA EVENTS S3 Code Commit DynamoDB Cognito SNS Cloud Watch Cloud Formation SES Config Echo / Alexa Kinesis API Gateway AWS IoT Cron (no complete list)

  18. API GATEWAY

  19. API 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.

  20. NETFLIX API GATEWAY

  21. API 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.

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

  23. API GATEWAY AUTHORIZATION

  24. API GATEWAY

  25. DYNAMODB

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

  27. Example USE CASES

  28. SERVERLESS WEB ARCHITECTURE

  29. SERVERLESS WEB ARCHITECTURE

  30. API Gateway with SNS , Push and SQS

  31. ALEXA SKILLS BOTS (CHAT/VOICE)

  32. TESTING

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

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

  35. COMPETITORS?

  36. COMPETITOR GOOGLE CLOUD FUNCTIONS JavaScript

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

  38. ON PREMISE ?

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

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

  41. IBM OPENWHISK JAVASCRIPT EXAMPLE function main(params) { return {payload: 'Hello, ' + params.name}; } Create the action in OpenWhisk $ wsk action create hello hello.js Run the action $ wsk action invoke hello --blocking --result --param name Niko Result { "payload": "Hello, Niko" }

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

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

  44. 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

  45. SERVERLESS 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"

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

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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend