Taming Serverless Dragons - Multi-Provider Serverless Apps

Dad87927739931f134c5b1242e3d04bc?s=47 James Thomas
February 01, 2017

Taming Serverless Dragons - Multi-Provider Serverless Apps

Serverless Framework has recently introduced support for multiple serverless providers You can now deploy serverless applications to OpenWhisk, Google Cloud Functions and Azure Functions as well as AWS Lambda. This allows you to develop platform-independent serverless applications. James Thomas has been working on the OpenWhisk implementation. In this talk, he will introduce the new feature, show you how to run serverless applications on different providers and explain the challenges in developing platform-agnostic serverless apps

Dad87927739931f134c5b1242e3d04bc?s=128

James Thomas

February 01, 2017
Tweet

Transcript

  1. TAMING DRAGONS (AKA MULTI-PROVIDER SERVERLESS APPS) JAMES THOMAS (IBM) @THOMASJ

  2. PROVIDERS

  3. WHY SWITCH PROVIDERS?

  4. PERFORMANCE RUNTIMES OPEN-SOURCE MULTI-CLOUD

  5. HERE BE DRAGONS

  6. None
  7. None
  8. None
  9. None
  10. # serverless.yml service: my_service provider: name: aws functions: hello: handler:

    handler.hello # handler.js runtime: nodejs memory: 512 events: - http: GET /api/hello
  11. # serverless.yml service: my_service provider: name: openwhisk functions: hello: handler:

    handler.hello # handler.js runtime: nodejs memory: 512 events: - http: GET /api/hello
  12. RELEASE THE DRAGONS PLATFORMS

  13. HERE BE (MORE)
 DRAGONS

  14. INTERFACES

  15. // aws lambda exports.handler = function(event, context, callback) { callback(null,

    "some success message"); } // openwhisk exports.handler = function(params) { return {msg: "some success message"}; }; // azure functions module.exports = function(context, args...) { context.done(null, {msg: "some success message"}) }; // google cloud functions exports.handler = function(event, callback) { callback(null, "some success message"); };
  16. None
  17. INTERFACES RUNTIMES

  18. https:// achieveme nt- images.tea v6.9.1 v6.10.0 v6.5.0 v6.9.1 v8 v8

    ? ? v2.7 v3.6.1 v2.7 v3.6.0 v2.7 ?
  19. supports and supports supports no other runtimes , and supports

    using dotnet (core)
  20. INTERFACES RUNTIMES EVENTS

  21. HTTP ✓ ✓ ✓ ✓ CRON ✓ ✓ ✓ ✗

    QUEUE ✓ ✓ ✓ ✓ DB ✓ ✓ ✓ ✗
  22. # aws lambda functions: hello: events: - http: GET /api/hello


    # azure functions functions: hello: events: - http: x-azure-settings: methods: - GET route: /api/hello # openwhisk functions: hello: events: - http: GET /api/hello # google cloud functions functions: hello: events: - http: /api/hello
  23. supports six event sources supports fifteen event sources supports six

    event sources supports three event sources * - supports adding other event sources
  24. INTERFACES RUNTIMES EVENTS SDKS

  25. // aws lambda var aws = require('aws-sdk'); var lambda =

    new aws.Lambda(); var params = {FunctionName: 'id', Payload: JSONPayload}; lambda.invoke(params, function(error, data) { // do something }); // openwhisk var openwhisk = require('openwhisk'); var options = {apihost: 'openwhisk.ng.bluemix.net', api_key: '...'}; var ow = openwhisk(options); ow.actions.invoke({actionName: ‘...'}).then();
  26. None
  27. INTERFACES RUNTIMES EVENTS SDKS RESOURCES

  28. None
  29. REDIS ✓ ✓ ✓ ✓ ELASTIC SEARCH ✓ ✓ ✓

    ✓ KAFKA ✓ ✓ ✓ ✓ MYSQL ✓ ✓ ✓ ✓
  30. WATSON ✓ ✗ ✗ ✗ REDSHIFT ✗ ✓ ✗ ✗

    COSMOS ✗ ✗ ✓ ✗ SPANNER ✗ ✗ ✗ ✓
  31. INTERFACES RUNTIMES EVENTS SDKS RESOURCES

  32. 2016 + serverless =

  33. HERE BE DRAGONS

  34. SUMMON INNER KHALSEI (USE SERVERLESS FRAMEWORK) SUMMON INNER-KHALEESI

  35. None
  36. None
  37. QUESTIONS? @THOMASJ