2. Jeremias Werner
Senior Software Developer – IBM Cloud Functions
jerewern@de.ibm.com
• 10 Years in IBM, almost cloud computing (IaaS, PaaS, FaaS)
• Proud dad of a 4 ½ yr and 1 yr old daughter
Coming together is a beginning, staying
together is progress, and working
together is success.
—Henry Ford
3. IBM Cloud Functions
Agenda
1. What is serverless?
2. What are the advantages of serverless and why should I care?
3. What is IBM Cloud Functions?
4. What is IBM Cloud Functions good for?
4. IBM Cloud Functions
1. What is serverless?
2. What are the advantages of serverless and why should I care?
3. What is IBM Cloud Functions?
4. What is IBM Cloud Functions good for?
Agenda
5. IBM Cloud Functions
Focus more on code, less on
infrastructure
Increasingfocuson
businesslogic
Decreasing concern (and control) over
stack implementation
Bare Metal
Virtual machines
Functions
Containers
Apps
What is serverless?
6. IBM Cloud FunctionsWhat is serverless?
In a nutshell:
When to use serverless?
“I have code and
I want it to be
executed only when
needed - at any
scale”
7. IBM Cloud Functions
Runs code only on-demand on a
per-request basis
No management and
operation of infrastructures
Focus on developing value-
adding code and on driving
innovations
No servers Just code
What is serverless?
8. IBM Cloud Functions
Runs code only on-demand on a
per-request basis
Transparently
scales with the
number of
requests being
served
What is serverless?
9. IBM Cloud Functions
Runs code only on-demand on a
per-request basis
Only pay for
resources being
used, instead of
resources idling
around
What is serverless?
10. IBM Cloud Functions
1. What is serverless?
2. What are the advantages of serverless and why should I care?
3. What is IBM Cloud Functions?
4. What is IBM Cloud Functions good for?
Agenda
11. IBM Cloud FunctionsWhat are the advantages of serverless and why should I care?
Worry about scaling
• When to scale? (mem-, cpu-, response time-, etc. driven?)
• How fast can you scale?
Worry about resiliency & cost
• At least 2 processes for HA
• Keep them running & healthy
• Deployment in multiple regions
Charged even when idling / not 100% utilized
Continuous polling due to missing event programming model
Traditional model
Process
and Idle
12. IBM Cloud Functions
Scales inherently
• One process per request
No cost overhead for resiliency
• No long running process to be made HA / multi-region
Introduces event programming model
Charges only for what is used
• Only worry about code
higher dev velocity, lower operational costs
Serverless model
What are the advantages of serverless and why should I care?
Deploy actions
within millisecs,
run it, free up
resources
13. IBM Cloud Functions
Loyalty Vending Machine Scenario - IBM Cloud VMs
b1.2x4 0.105
t2 medium rhel 0.185
t2.medium windows 0.135
Average 0.14166667
server average monthly 102
automation 12
elb monthly 15
mgmt monthly 150
security monthly 21.6
total monthly price per server 300.6
number of servers 2
cluster annually 7214.4
number of environments 3
turn off discount 30
Total annually 15,150.24
Loyalty Vending Machine Scenario - IBM Cloud Functions
Calls per month 30,000,000.00
calls per day 1,000,000.00
calls per sec 11.57
memory 0.5
Duration sec 0.5
Gbsec per call 0.25
Gbsec per month 7,500,000.00
Free tier GBsec 400,000.00
Adjusted Gbsec/mo 7,100,000.00
Cost per Gbsec 0.000017
Cost for Gbsec 120.70
Total monthly 120.70
Total annually 1,448.40
Total Cost of Ownership
(Blog: https://www.ibm.com/blogs/bluemix/2018/09/estimate-compute-costs)
What are the advantages of serverless and why should I care?
14. IBM Cloud Functions
1. What is serverless?
2. What are the advantages of serverless and why should I care?
3. What is IBM Cloud Functions?
4. What is IBM Cloud Functions good for?
Agenda
15. IBM Cloud Functions
Available as managed service on
IBM Cloud
cloud.ibm.com/openwhisk
FaaS platform to execute
code in a serverless fashion
What is IBM Cloud Functions?
16. IBM Cloud Functions
Software also available as
open-source via Apache:
openwhisk.org
Ready to be downloaded,
installed, and managed by you
and on your hardware
What is IBM Cloud Functions?
FaaS platform to execute
code in a serverless fashion
17. IBM Cloud Functions
Any language or
binary is
supported
What is IBM Cloud Functions fka OpenWhisk?
Natively
supported
languages
(performance-
optimized)
Any other
language
supported via
container upload
JS/NodeJS
6/8/10
Java
PHP
Swift 4
Python 3
C/C++ Rust
bash
<your docker
container>
Ruby
Cobol …
Go .Netnew
new
18. IBM Cloud FunctionsWhat is IBM Cloud Functions fka OpenWhisk?
Periodic Cloudant Event Stream
Mobile Push Github AppConnect
API Gateway
Watson
Conversation
Event
Provider
20. IBM Cloud Functions
1. What is serverless?
2. What are the advantages of serverless and why should I care?
3. What is IBM Cloud Functions?
4. What is IBM Cloud Functions good for?
Agenda
21. IBM Cloud Functions
While IBM Cloud Functions is the key anchor point for serverless, there is a growing
set of services from other domains also delivering serverless attributes
This enables customers to build application topologies which are entirely
serverless
What is IBM Cloud Functions good for?
Serverless Application Platform
Cloudant Object
Storage
Event
Streams
API
Gateway
Watson
services
SQL
service
Cloud
Functions
22. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Common use cases
• Serverless API Backends / Microservices
• Massively parallel compute / “Map” operations
• Parallel data (& compute) processing
• Data-at-rest processing & ETL pipelines
• Data processing enriched with cognitive capabilities
• Event Stream Processing
• Scheduled tasks
• Mobile backends
• IoT
• Conversational applications
23. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Allows to map API
endpoints
to IBM Cloud
Functions actions
API GW available for free, without limits.
Define Actions:
getCostumer
createCostumer
deleteCostumer
Define API Endpoints (URLs) and map to Actions
Get: mydomain.com/…/customers
Post: mydomain.com/…/customers
Delete: mydomain.com/…/customers
12
Microservices/
API Backends
24. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Data
processing
Ideally suited for working with structured
data, text, audio, image and video data:
25. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Data
processing
http://ecc.ibm.com/case
-study/us-en/ECCF-
CDC12387USEN
10x faster
90% less cost
26. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Cloud Functions is
used to compute
the content of user
dashboards
ESPN Fantasy
Football
(Source: https://developer.ibm.com/articles/watson-behind-the-code-fantasy-football-2018-part7)
27. IBM Cloud Functions
Massively parallel compute / “Map” operations
What is IBM Cloud Functions good for?
Any kind of embarrassingly parallel task is very well-suited to be run on
a serverless runtime. Each parallelizable task results in one action
invocation
• Data search & processing (specifically Cloud Object Storage)
• Map(-Reduce) operations
• Monte-Carlo Simulations
• Hyperparameter tuning
• Web scraping
• Genome processing
• …
28. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Parallel Compute &
Data Processing
Run any kind of embarrassingly parallel task by
invoking functions 1000’s of times in parallel.
E.g. very well-suited for monte-carlo
simulations, machine learning inferencing, data
science tasks, ….
IBM-PyWren deploys, runs and monitors
standard Python code as parallel serverless
actions on IBM Cloud Functions
• Extends PyWren from the RISE Lab
Number of forecasts Local run Cloud Functions
1000 154 secs 20 secs
100,000 ~10,000 secs ~140 secs
https://developer.ibm.com/code/open/centers/codait/projects/pywren/
29. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Processing
unstructured data
Example, a data scientist wants to
prepare images of people for deep
learning
IBM Cloud
Functions
IBM Cloud Object Store
30. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
Example:
Serverless AI Pipeline
1.Serverless upload with Aspera
2.Serverless storage with COS
3.Serverless data preparation with
Cloud Functions and PyWren
4.Machine learning with Watson
Machine Learning
IBM Cloud
Functions
IBM Cloud
Object Store
Machine
Learning
Aspera
31. IBM Cloud Functions
Event stream processing
via Event Streams
What is IBM Cloud Functions good for?
Managed Apache
Kafka service for real-
time build outs of data
pipelines and
streaming apps
Ideally suited for working with all sorts of data stream
ingestions (for validation, cleansing, enrichment,
transformation, …)
Business data streams (from other data sources)
IoT sensor data
Log data
Financial (market) data
…
IBM
Event Streams
32. IBM Cloud FunctionsWhat is IBM Cloud Functions good for?
IoT Trigger events based on
IoT sensor data
Device
Watson IOT
Platform
2
3
Trigger
an Action
IOT
(related blog: https://www.ibm.com/blogs/bluemix/2018/09/how-kone-uses-data-analytics-and-event-driven-maintenance-to-keep-cities-in-motion/)
Example KONE
• eliminate or reduce the time that KONE
equipment goes out of service.
• Sensor data from the equipment can
reveal potential issues and risks before
human eyes and ears can detect them
• event-driven architecture that allocates
the compute resources required to
handle each incoming stream of data,
automatically scaling as needed.
1