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

Taming Serverless Dragons - Multi-Provider Serverless Apps

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

James Thomas

February 01, 2017
Tweet

More Decks by James Thomas

Other Decks in Technology

Transcript

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

    View Slide

  2. PROVIDERS

    View Slide

  3. WHY
    SWITCH
    PROVIDERS?

    View Slide

  4. PERFORMANCE
    RUNTIMES
    OPEN-SOURCE
    MULTI-CLOUD




    View Slide

  5. HERE BE
    DRAGONS

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  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

    View Slide

  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

    View Slide

  12. RELEASE
    THE
    DRAGONS
    PLATFORMS

    View Slide

  13. HERE BE
    (MORE)

    DRAGONS

    View Slide

  14. INTERFACES

    View Slide

  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");
    };

    View Slide

  16. View Slide

  17. INTERFACES
    RUNTIMES


    View Slide

  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 ?

    View Slide

  19. supports and
    supports
    supports no other runtimes
    , and
    supports using dotnet (core)

    View Slide

  20. INTERFACES
    RUNTIMES
    EVENTS



    View Slide

  21. HTTP ✓ ✓ ✓ ✓
    CRON ✓ ✓ ✓ ✗
    QUEUE ✓ ✓ ✓ ✓
    DB ✓ ✓ ✓ ✗

    View Slide

  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

    View Slide

  23. supports six event sources
    supports fifteen event sources
    supports six event sources
    supports three event sources
    * - supports adding other event sources

    View Slide

  24. INTERFACES
    RUNTIMES
    EVENTS
    SDKS




    View Slide

  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();

    View Slide

  26. View Slide

  27. INTERFACES
    RUNTIMES
    EVENTS
    SDKS
    RESOURCES





    View Slide

  28. View Slide

  29. REDIS ✓ ✓ ✓ ✓
    ELASTIC
    SEARCH
    ✓ ✓ ✓ ✓
    KAFKA ✓ ✓ ✓ ✓
    MYSQL ✓ ✓ ✓ ✓

    View Slide

  30. WATSON ✓ ✗ ✗ ✗
    REDSHIFT ✗ ✓ ✗ ✗
    COSMOS ✗ ✗ ✓ ✗
    SPANNER ✗ ✗ ✗ ✓

    View Slide

  31. INTERFACES
    RUNTIMES
    EVENTS
    SDKS
    RESOURCES





    View Slide

  32. 2016 + serverless =

    View Slide

  33. HERE BE
    DRAGONS

    View Slide

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

    View Slide

  35. View Slide

  36. View Slide

  37. QUESTIONS?
    @THOMASJ

    View Slide