Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Serverless Cloud Architectures

Niko Köbler
November 08, 2016

Serverless Cloud Architectures

Niko Köbler

November 08, 2016
Tweet

More Decks by Niko Köbler

Other Decks in Programming

Transcript

  1. Serverless is about the of servers. Build and run applications

    servers. management without thinking about
  2. 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
  3. 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
  4. 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
  5. AWS EXAMPLE LAMBDA NODE exports.handler = (event, context) => {

    console.log('Received event:', JSON.stringify(event)); }
  6. 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; } }
  7. 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
  8. 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
  9. 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
  10. DYNAMO Fully Managed NoSQL Data Store Schemaless Data Model Seamless

    Scalabiltiy, "no limits" Pay by Read-/Write-Capacity-Units DB
  11. TESTING Environment, Infrastructure max. 1024 of running processes/threads max. 100

    concurrent Lambdas per Region no remote debugging INTEGRATION TESTS
  12. COMPETITOR IBM BLUEMIX Bluemix Cloud & OnPremise Open Source /

    Apache License v2.0 JavaScript (Node.js), Python and... Swi ! Docker Support Function-Chaining OPENWHISK
  13. 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" }
  14. Overview: Documentation, Logging & Monitoring, Metrics ! (typical things for

    distributed environments) Cloud Provider Binding / Dependency: APIs, Portability, Costs, SLAs DRAWBACKS
  15. ? WANT TO START? Give a try! Manages all the

    Cloud-Resources and Deployment. CURIOUS serverless.com
  16. 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
  17. 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
  18. THANK ! ANY ? Slides: Niko Köbler So ware-Architect, Developer

    & Trainer | | YOU QUESTIONS http://bit.ly/serverless-slides [email protected] www.n-k.de @dasniko
  19. 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