© 2017 IBM Corporation l Interconnect 2017
Serveless
OpenWhisk
NodeJS Serverless backend for your frontend
NCDevCon17 (Oct. 7-8)
l NCDevCon 2017
@csantanapr
NCDevCon 2017
@csantanapr
Agenda
1. Evolution of serverless
2. What is serverless aka FaaS?
3. Bluemix: What is it?
4. OpenWhisk: What is it & what’s new?
5. What is serverless good for?
6. Q&A
NCDevCon 2017
@csantanapr
Agenda
1. Evolution of serverless
2. What is serverless aka FaaS?
3. Bluemix: What is it?
4. OpenWhisk: What is it & what’s new?
5. What is serverless good for?
6. Q&A
NCDevCon 2017
@csantanaprEvolution of serverless
Increasingfocusonbusinesslogic
Decreasing concern (and control) over stack implementation
Bare Metal
VM VM
VM
Virtual machines
Functions
Containers
NCDevCon 2017
@csantanapr
Runs code only on-demand on
a per-request basis
Serverless
deployment &
operations model
VM
No servers Just code
Evolution of serverless
NCDevCon 2017
@csantanapr
Runs code in response to
events
Event-
programming
model
Evolution of serverless
NCDevCon 2017
@csantanapr
Agenda
1. Evolution of serverless
2. What is serverless aka FaaS?
3. Bluemix: What is it?
4. OpenWhisk: What is it & what’s new?
5. What is serverless good for?
6. Q&A
NCDevCon 2017
@csantanaprBluemix
Your Own Hosted Apps / Services
Platform Deployment Options to meet Workload Requirements
Bluemix
Public
Bluemix
Dedicated
Bluemix
Local*
Powered by IBMSoftLayer In Your Data Center
Flexible Compute Options to Run Apps
Containers Virtual Machines
DevOps
Tooling
+
Integration
& API Mgmt
+
Catalog of Services that Extend Apps Functionality
Web Data Mobile AnalyticsCognitive IoT Security Yours
+
US-South,EU-GB,AU-SYD
Event Runtimes Instant Runtimes
Bluemix is built on 4
key open compute
technologies:
OpenWhisk, Cloud
Foundry, Docker, and
OpenStack, and
delivered by 3
deployment options:
Public, Dedicated and
Local.
It extends each of
these with a growing
number of services,
robust DevOps
tooling, integration
capabilities, and a
seamless developer
experience.
NCDevCon 2017
@csantanapr
Agenda
1. Evolution of serverless
2. What is serverless aka FaaS?
3. Bluemix: What is new?
4. OpenWhisk: What is it & what’s new?
5. What is serverless good for?
6. Q&A
NCDevCon 2017
@csantanaprOpenWhisk
FaaS platform
to execute code
in response to
events
What is OpenWhisk?
NCDevCon 2017
@csantanapr
Available as

open source via Apache
openwhisk.org
FaaS platform to execute code
in response to events
OpenWhisk
NCDevCon 2017
@csantanapr
FaaS platform to execute code
in response to events
OpenWhisk
Also available as managed service on

IBM Bluemix
bluemix.net/openwhisk
NCDevCon 2017
@csantanapr
Triggers
(response)
Rules
Actions
(code)
Source
(events) Results
OpenWhisk
Concepts
NCDevCon 2017
@csantanaprOpenWhisk
Supported
Languages
JS/NodeJS Swift
Python
Java Docker
Go Haskell
Scala . . .
Multi-
language
Support
Community
Efforts
… and more to come
JS/NodeJS
Java
Python
Swift
Docker
Haskell
…
Scala
PHP
New
NCDevCon 2017
@csantanaprOpenWhisk
Non-blocking
Blocking
Periodic
Support for
different invocation
models
NCDevCon 2017
@csantanaprOpenWhisk
Supports
higher-level
programming
constructs Chaining/
Sequencing
Action 1
Action 2
Parameter
Binding
Default Name
Default
Parameters
Default Value
NCDevCon 2017
@csantanaprOpenWhisk
Event
Provider
Open event emitter
(consumer ecosystem)
Open interface

for event emitters
NCDevCon 2017
@csantanaprOpenWhisk
zzz
time
chargedGranular pricing
Pay only for the exact time your actions run. When
an action is not invoked, it’s not in memory, so you
don’t pay anything.
NCDevCon 2017
@csantanaprOpenWhisk
Memory
allocated
(MB)
Time executing
(milliseconds)
Instances
executing
simultaneously
(count)
Reduce Costs
Time an action was running

* memory allocated to action



$ 0.000017 per GBs
Free tier: 400000 GBs
NCDevCon 2017
@csantanaprOpenWhisk
Controller
…Invoker InvokerInvoker
Apache OpenWhisk
NCDevCon 2017
@csantanapr
Gives you full control over HTTP
request/response from within an
action
Web Actions
Serverless microservice APIs/backend
What is OpenWhisk good for?
Another way to invoke an action is via
our newest web action capabilities.
Those OpenWhisk actions quickly
enable you to build web based
applications. Allowing backend logic
which your web application can
access  anonymously without requiring
an OpenWhisk authentication key. It is
up to the action developer to
hello
Client
Openwhisk
IBM Cloudant
Enable Action to be a WebAction
NCDevCon 2017
@csantanaprOpenWhisk
API Gateway
support
Allows to map API endpoints to
OpenWhisk actions.

API Gateway takes care of security,
control (e.g. rate limiting), mediation,
parameter mapping, schema
validation & supports different verbs
NCDevCon 2017
@csantanapr
DEMOS
NCDevCon 2017
@csantanaprOpenWhisk
Demo 1: echo action
JSON JSONACTION
NCDevCon 2017
@csantanaprOpenWhisk
Demo 2: hello Web Action
JSON
JSON
ACTIONCONTROLLER
HTTP
Request
HTTP
Response
NCDevCon 2017
@csantanaprOpenWhisk
Demo 3: HTTP Content-Type
text/html
JSON
index
text
json
text/plain
application/json
Web
Browser
NCDevCon 2017
@csantanaprOpenWhisk
Demo 4: HTTP Form POST
text/html
JSON
index
form
Web
Browser
text/html
form/x-form-url-encoded
NCDevCon 2017
@csantanaprOpenWhisk
Demo 5: APIGateway REST API
POST/PUT
JSON
dbInsert
dbGet
dbDelete
GET
DELETE
https://api.csantanapr.com/db/friends
HTTP
Client
NCDevCon 2017
@csantanaprOpenWhisk
Demo 5: APIGateway Configuration https://api.csantanapr.com/db/friends
NCDevCon 2017
@csantanaprOpenWhisk
Demo 5: APIGateway Analytics https://api.csantanapr.com/db/friends
NCDevCon 2017
@csantanaprOpenWhisk & Containers
Basically, OpenWhisk is based on
Docker… but we added some
smartness to meet our performance
goals…
Behind the scenes:
It’s about containers
NCDevCon 2017
@csantanapr
A =
wsk action invoke docker run
≈
OpenWhisk & Containers
NCDevCon 2017
@csantanapr
Start container
docker run
Initialize
/init
Run
/run
cold container
OpenWhisk & Containers
NCDevCon 2017
@csantanapr
Start container
docker run
Initialize
/init
Run
/run
39
pre-warmed container
OpenWhisk & Containers
NCDevCon 2017
@csantanapr
Start container
docker run
Initialize
/init
Run
/run
warm container
OpenWhisk & Containers
NCDevCon 2017
@csantanapr
cold container pre-warmed container warm container
faster
Performance is king…
OpenWhisk & Containers
NCDevCon 2017
@csantanapr
Agenda
1. Evolution of serverless
2. What is serverless aka FaaS?
3. Bluemix: What is it?
4. OpenWhisk: What is it & what’s new?
5. What is serverless good for?
6. Q&A
NCDevCon 2017
@csantanapr
Commercial offering home:
bluemix.net/openwhisk
Open-source offering home:
openwhisk.org
Slack:
slack.openwhisk.org
Learn more
Learn
more
NCDevCon 2017
@csantanapr
Github github.com/openwhisk
Twitter twitter.com/openwhisk
Medium medium.com/openwhisk
Slideshare slideshare.net/OpenWhisk
Youtube youtube.com/channel/
UCbzgShnQk8F43NKsvEYA1SA
Learn more
Learn
more
NCDevCon 2017
@csantanapr
Q&A
NCDevCon 2017
@csantanapr
Backup
NCDevCon 2017
@csantanapr
Monitoring
OpenWhisk
Open Engine
Docker (and potentially other abstractions going forward)
*work in progress
REST
Action 2
Swift
Action 3
NodeJS
Action 5
Docker
Action 4
Docker
Action 1
NodeJS
Rule
Rule
Rule
Service Ecosystem
Bluemix Services
3rd Party Services
Self-enabled
Services
Invoke
Debugger
WebActionsCLI SDKUIIDE API Gateway*
Package
Feed
Package
Feed
Triggers
Package
Feed

NodeJS Serverless backends for your frontends