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

Taming Serverless Dragons - Multi-Provider Serv...

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. # serverless.yml service: my_service provider: name: aws functions: hello: handler:

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

    handler.hello # handler.js runtime: nodejs memory: 512 events: - http: GET /api/hello
  3. // 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"); };
  4. HTTP ✓ ✓ ✓ ✓ CRON ✓ ✓ ✓ ✗

    QUEUE ✓ ✓ ✓ ✓ DB ✓ ✓ ✓ ✗
  5. # 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
  6. supports six event sources supports fifteen event sources supports six

    event sources supports three event sources * - supports adding other event sources
  7. // 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();
  8. REDIS ✓ ✓ ✓ ✓ ELASTIC SEARCH ✓ ✓ ✓

    ✓ KAFKA ✓ ✓ ✓ ✓ MYSQL ✓ ✓ ✓ ✓
  9. WATSON ✓ ✗ ✗ ✗ REDSHIFT ✗ ✓ ✗ ✗

    COSMOS ✗ ✗ ✓ ✗ SPANNER ✗ ✗ ✗ ✓