SlideShare a Scribd company logo
© 2017 IBM Corporation l Interconnect 2017
IBM Bluemix

Apache
OpenWhisk
Building serverless applications
with Apache OpenWhisk
@Joe_Sepi
Joe Sepi

Developer Advocate, IBM
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Increasingfocusonbusinesslogic
Decreasing concern (and control) over stack implementation
Bare Metal
VM VM
VM
Virtual machines
Functions
Containers
Serverless developers focus more on code, less on infrastructure
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Monolithic
Application
Break-down into
microservices
Make each
microservice HA
Protect against
regional outage
Region A
Region B
Microservices can be hard to manage at scale
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Emerging workloads are a good fit for event-driven programming
Execute logic in response to database change
Perform analytics on sensor input messages
Provide cognitive computing via chatbots
Schedule tasks performed for a short time
Invoke autoscaled APIs and mobile backends
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Memory
allocated
(MB)
Time executing
(milliseconds)
Instances
executing
simultaneously
(count)
Cloud resource cost
better matches
business value gained
Not a silver bullet, but this can result in
substantial savings for many workloads
New cost models more accurately charge for usage
IBM Bluemix Apache OpenWhisk@Joe_Sepi
OpenWhisk is a
cloud platform that
executes code in
response to events
OpenWhisk enables these serverless, event-driven workloads
Provides serverless deployment and operations model
Runs code only on-demand on a per-request basis
Optimized utilization, fine-grained metering at any scale
Flexible, extensible, polyglot programming model
Open source and open ecosystem (Apache Incubator)
Ability to run in public, private, and hybrid models
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Results
Developers work with packages, triggers, actions, and rules
Package
(feed)
Packages provide integration
with external event sources
P
Trigger
(event)
T
Data sources define events
they emit as Triggers
Rule (map)R
Action
(function)
A
Developers map Actions
to Triggers via Rules
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Apache
Incubator
OpenWhisk is built on solid open source foundations
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix provides management, tooling, and monitoring
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Sign up for an account at bluemix.net, then download CLI
© 2017 IBM Corporation l Interconnect 2017
IBM Bluemix
Apache OpenWhisk programming model
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Developers work with triggers, actions, rules, and packages
Data sources define events
they emit as Triggers.
Developers map Actions to
Triggers via Rules.
Packages provide integration
with external services.
T
A
P
R
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Triggers
A class of events that can occurT
Social events
Data changes
Device readings Location updates
User input
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Code that runs in response to an event
(that is, an event handler)
A
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Can be written in a variety of languages, such as
JavaScript, Python, Java, and Swift
A
function main(params) {
return { message: 'Hello, ' + params.name + ' from ' + params.place };
};
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Or any other language by packaging with DockerA
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Actions
Can be composed to create sequences
that increase flexibility and foster reuse
A
AA := A1 + A2 + A3
AB := A2 + A1 + A3
AC := A3 + A1 + A2
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Rules
An association of a trigger to an action
in a many to many mapping.
R
R := T A
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Packages
A shared collection of triggers and actionsP
A
A read
write
T changes A translate A forecast
A post
T topic
Open
Source A myAction
T myFeed
Yours
T commit
Third
Party
© 2017 IBM Corporation l Interconnect 2017
IBM Bluemix
Apache OpenWhisk in action
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Bluemix Interface
IBM Bluemix Apache OpenWhisk@Joe_Sepi
The OpenWhisk execution model
Pool of actions
Swift DockerJS
Trigger
1
Running
action
Running
action
Running
action
3
OpenWhisk
Engine
2 A
T
AAA
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Demo 1: Your first trigger, action, and rule
$ wsk action create handler handler.js
github.com/IBM/openwhisk-action-trigger-rule
$ wsk action invoke --blocking handler
$ wsk trigger create every-20-seconds 
--feed /whisk.system/alarms/alarm 
--param cron "*/20 * * * * *" 
--param maxTriggers 30
$ wsk action invoke --blocking handler
$ wsk rule create 
invoke-periodically 
every-20-seconds 
handler
Trigger
1
Running
action
2
T
A
1. Cron syntax alarm
2. Log the current time
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Demo 2: Database change triggered action
github.com/IBM/openwhisk-cloudant-trigger
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Demo 3: HTTP API request triggered action
github.com/IBM/openwhisk-rest-api-trigger
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Other sample applications
github.com/openwhisk/awesome-openwhisk
Project OpenFridge:
Improving customer service
with event driven IoT
Project OpenChecks
github.com/openwhisk/awesome-openwhisk
github.com/apache/incubator-openwhisk-external-resources
IBM Bluemix Apache OpenWhisk@Joe_Sepi
Managed service on

IBM Bluemix
bluemix.net/openwhisk
Delivered as

Open source via Apache
openwhisk.org
Get started on Bluemix, or explore the open source project
github.com/openwhisk
slack.openwhisk.org
twitter.com/openwhisk
medium.com/openwhisk
IBM Bluemix Apache OpenWhisk@Joe_Sepi
See more sample apps on GitHub
github.com/ibm
Reach out to us team
developer.ibm.com/code/work-with-us
Or, work with an IBM Code developer advocate
© 2017 IBM Corporation l Interconnect 2017
IBM Bluemix

Apache
OpenWhisk
Building serverless applications
with Apache OpenWhisk
@Joe_Sepi
Joe Sepi

Developer Advocate, IBM

More Related Content

PDF
Combining OpenWhisk (serverless), Open API (swagger) and API Connect to build...
PDF
Building serverless applications with Apache OpenWhisk and IBM Cloud Functions
PDF
Serverless APIs with Apache OpenWhisk
PDF
Apache OpenWhisk - KRnet 2017
PDF
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: The journey c...
PDF
When to use Serverless? When to use Kubernetes?
PDF
Reactive Microservices with Quarkus
PDF
Developing Serverless Applications with Apache OpenWhisk
Combining OpenWhisk (serverless), Open API (swagger) and API Connect to build...
Building serverless applications with Apache OpenWhisk and IBM Cloud Functions
Serverless APIs with Apache OpenWhisk
Apache OpenWhisk - KRnet 2017
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: The journey c...
When to use Serverless? When to use Kubernetes?
Reactive Microservices with Quarkus
Developing Serverless Applications with Apache OpenWhisk

What's hot (20)

PDF
Serverless architectures built on an open source platform
PDF
How to develop your first cloud-native Applications with Java - 30 Minutes
PDF
Containers vs serverless - Navigating application deployment options
PDF
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
PDF
Visual Recognition with Anki Cozmo and TensorFlow
PDF
OpenWhisk - A platform for cloud native, serverless, event driven apps
PDF
The CNCF on Serverless
PPTX
OpenWhisk: Event-driven Design
PDF
Create Alexa Skills using IBM Watson Conversation and Apache OpenWhisk
PDF
OpenWhisk Deep Dive: the action container model
PPTX
Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...
PDF
Building Cloud-agnostic Serverless APIs
PPTX
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
PDF
NodeJS Serverless backends for your frontends
PDF
A DevOps State of Mind with Microservices, Containers and Kubernetes
PDF
OpenWhisk Under the Hood -- London Oct 16 2016
PDF
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
PDF
SPRING BOOT DANS UN CONTAINER OUTILS ET PRATIQUES
PPTX
Shipping apps to eks with code pipeline and lambda functions
PDF
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
Serverless architectures built on an open source platform
How to develop your first cloud-native Applications with Java - 30 Minutes
Containers vs serverless - Navigating application deployment options
Jakarta Tech Talk: How to develop your first cloud-native Application with Java
Visual Recognition with Anki Cozmo and TensorFlow
OpenWhisk - A platform for cloud native, serverless, event driven apps
The CNCF on Serverless
OpenWhisk: Event-driven Design
Create Alexa Skills using IBM Watson Conversation and Apache OpenWhisk
OpenWhisk Deep Dive: the action container model
Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...
Building Cloud-agnostic Serverless APIs
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
NodeJS Serverless backends for your frontends
A DevOps State of Mind with Microservices, Containers and Kubernetes
OpenWhisk Under the Hood -- London Oct 16 2016
Andreas Nauerz and Michael Behrendt - Event Driven and Serverless Programming...
SPRING BOOT DANS UN CONTAINER OUTILS ET PRATIQUES
Shipping apps to eks with code pipeline and lambda functions
OpenFaaS - zero serverless in 60 seconds anywhere with case-studies
Ad

Similar to Building Serverless Applications on the Apache OpenWhisk Platform (20)

PDF
Building serverless applications with Apache OpenWhisk
PPT
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
PDF
OpenWhisk - Serverless Architecture
PPTX
Serverless Apps with Open Whisk
PDF
OpenWhisk Meetup - Austin, TX 07/2017
PDF
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
PDF
Serverless apps with OpenWhisk
PDF
Being serverless and Swift... Is that allowed?
PDF
Build a cloud native app with OpenWhisk
PPTX
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
PDF
Serverless architectures built on an open source platform
PPTX
IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Fut...
PDF
TechTalk Webinar Series - Getting Started with Apache OpenWhisk
PDF
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
PPT
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
PPT
IBM Bluemix Openwhisk
PDF
OpenWhisk Lab
PDF
Going Serverless with OpenWhisk
PDF
Your Java Journey into the Serverless World
PPT
OpenWhisk Introduction
Building serverless applications with Apache OpenWhisk
IBM Bluemix OpenWhisk: Serverless Conference 2016, London, UK: The Future of ...
OpenWhisk - Serverless Architecture
Serverless Apps with Open Whisk
OpenWhisk Meetup - Austin, TX 07/2017
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
Serverless apps with OpenWhisk
Being serverless and Swift... Is that allowed?
Build a cloud native app with OpenWhisk
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
Serverless architectures built on an open source platform
IBM Bluemix OpenWhisk: Cloud Foundry Summit 2016, Frankfurt, Germany: The Fut...
TechTalk Webinar Series - Getting Started with Apache OpenWhisk
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
IBM Bluemix OpenWhisk: Interconnect 2016, Las Vegas: CCD-1088: The Future of ...
IBM Bluemix Openwhisk
OpenWhisk Lab
Going Serverless with OpenWhisk
Your Java Journey into the Serverless World
OpenWhisk Introduction
Ad

More from Joe Sepi (7)

PPTX
Get Into Open Source
PDF
Acme Freight: Developing Microservices and APIs on Bluemix
PDF
API-first World Domination
PDF
Quick and Tasty APIs: just add data!
PDF
Micro Gateways are a Big Deal
PDF
JS Journeyman
PDF
Front End Dependency Management at CascadiaJS
Get Into Open Source
Acme Freight: Developing Microservices and APIs on Bluemix
API-first World Domination
Quick and Tasty APIs: just add data!
Micro Gateways are a Big Deal
JS Journeyman
Front End Dependency Management at CascadiaJS

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
cuic standard and advanced reporting.pdf
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
A Presentation on Artificial Intelligence
PDF
Electronic commerce courselecture one. Pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
20250228 LYD VKU AI Blended-Learning.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Dropbox Q2 2025 Financial Results & Investor Presentation
Unlocking AI with Model Context Protocol (MCP)
cuic standard and advanced reporting.pdf
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
A Presentation on Artificial Intelligence
Electronic commerce courselecture one. Pdf
Empathic Computing: Creating Shared Understanding
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Encapsulation theory and applications.pdf
Approach and Philosophy of On baking technology
Understanding_Digital_Forensics_Presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx

Building Serverless Applications on the Apache OpenWhisk Platform

  • 1. © 2017 IBM Corporation l Interconnect 2017 IBM Bluemix Apache OpenWhisk Building serverless applications with Apache OpenWhisk @Joe_Sepi Joe Sepi Developer Advocate, IBM
  • 2. IBM Bluemix Apache OpenWhisk@Joe_Sepi Increasingfocusonbusinesslogic Decreasing concern (and control) over stack implementation Bare Metal VM VM VM Virtual machines Functions Containers Serverless developers focus more on code, less on infrastructure
  • 3. IBM Bluemix Apache OpenWhisk@Joe_Sepi Monolithic Application Break-down into microservices Make each microservice HA Protect against regional outage Region A Region B Microservices can be hard to manage at scale
  • 4. IBM Bluemix Apache OpenWhisk@Joe_Sepi Emerging workloads are a good fit for event-driven programming Execute logic in response to database change Perform analytics on sensor input messages Provide cognitive computing via chatbots Schedule tasks performed for a short time Invoke autoscaled APIs and mobile backends
  • 5. IBM Bluemix Apache OpenWhisk@Joe_Sepi Memory allocated (MB) Time executing (milliseconds) Instances executing simultaneously (count) Cloud resource cost better matches business value gained Not a silver bullet, but this can result in substantial savings for many workloads New cost models more accurately charge for usage
  • 6. IBM Bluemix Apache OpenWhisk@Joe_Sepi OpenWhisk is a cloud platform that executes code in response to events OpenWhisk enables these serverless, event-driven workloads Provides serverless deployment and operations model Runs code only on-demand on a per-request basis Optimized utilization, fine-grained metering at any scale Flexible, extensible, polyglot programming model Open source and open ecosystem (Apache Incubator) Ability to run in public, private, and hybrid models
  • 7. IBM Bluemix Apache OpenWhisk@Joe_Sepi Results Developers work with packages, triggers, actions, and rules Package (feed) Packages provide integration with external event sources P Trigger (event) T Data sources define events they emit as Triggers Rule (map)R Action (function) A Developers map Actions to Triggers via Rules
  • 8. IBM Bluemix Apache OpenWhisk@Joe_Sepi Apache Incubator OpenWhisk is built on solid open source foundations
  • 9. IBM Bluemix Apache OpenWhisk@Joe_Sepi Bluemix provides management, tooling, and monitoring
  • 10. IBM Bluemix Apache OpenWhisk@Joe_Sepi Bluemix provides management, tooling, and monitoring
  • 11. IBM Bluemix Apache OpenWhisk@Joe_Sepi Bluemix provides management, tooling, and monitoring
  • 12. IBM Bluemix Apache OpenWhisk@Joe_Sepi Sign up for an account at bluemix.net, then download CLI
  • 13. © 2017 IBM Corporation l Interconnect 2017 IBM Bluemix Apache OpenWhisk programming model
  • 14. IBM Bluemix Apache OpenWhisk@Joe_Sepi Developers work with triggers, actions, rules, and packages Data sources define events they emit as Triggers. Developers map Actions to Triggers via Rules. Packages provide integration with external services. T A P R
  • 15. IBM Bluemix Apache OpenWhisk@Joe_Sepi Triggers A class of events that can occurT Social events Data changes Device readings Location updates User input
  • 16. IBM Bluemix Apache OpenWhisk@Joe_Sepi Actions Code that runs in response to an event (that is, an event handler) A
  • 17. IBM Bluemix Apache OpenWhisk@Joe_Sepi Actions Can be written in a variety of languages, such as JavaScript, Python, Java, and Swift A function main(params) { return { message: 'Hello, ' + params.name + ' from ' + params.place }; };
  • 18. IBM Bluemix Apache OpenWhisk@Joe_Sepi Actions Or any other language by packaging with DockerA
  • 19. IBM Bluemix Apache OpenWhisk@Joe_Sepi Actions Can be composed to create sequences that increase flexibility and foster reuse A AA := A1 + A2 + A3 AB := A2 + A1 + A3 AC := A3 + A1 + A2
  • 20. IBM Bluemix Apache OpenWhisk@Joe_Sepi Rules An association of a trigger to an action in a many to many mapping. R R := T A
  • 21. IBM Bluemix Apache OpenWhisk@Joe_Sepi Packages A shared collection of triggers and actionsP A A read write T changes A translate A forecast A post T topic Open Source A myAction T myFeed Yours T commit Third Party
  • 22. © 2017 IBM Corporation l Interconnect 2017 IBM Bluemix Apache OpenWhisk in action
  • 23. IBM Bluemix Apache OpenWhisk@Joe_Sepi Bluemix Interface
  • 24. IBM Bluemix Apache OpenWhisk@Joe_Sepi The OpenWhisk execution model Pool of actions Swift DockerJS Trigger 1 Running action Running action Running action 3 OpenWhisk Engine 2 A T AAA
  • 25. IBM Bluemix Apache OpenWhisk@Joe_Sepi Demo 1: Your first trigger, action, and rule $ wsk action create handler handler.js github.com/IBM/openwhisk-action-trigger-rule $ wsk action invoke --blocking handler $ wsk trigger create every-20-seconds --feed /whisk.system/alarms/alarm --param cron "*/20 * * * * *" --param maxTriggers 30 $ wsk action invoke --blocking handler $ wsk rule create invoke-periodically every-20-seconds handler Trigger 1 Running action 2 T A 1. Cron syntax alarm 2. Log the current time
  • 26. IBM Bluemix Apache OpenWhisk@Joe_Sepi Demo 2: Database change triggered action github.com/IBM/openwhisk-cloudant-trigger
  • 27. IBM Bluemix Apache OpenWhisk@Joe_Sepi Demo 3: HTTP API request triggered action github.com/IBM/openwhisk-rest-api-trigger
  • 28. IBM Bluemix Apache OpenWhisk@Joe_Sepi Other sample applications github.com/openwhisk/awesome-openwhisk Project OpenFridge: Improving customer service with event driven IoT Project OpenChecks github.com/openwhisk/awesome-openwhisk github.com/apache/incubator-openwhisk-external-resources
  • 29. IBM Bluemix Apache OpenWhisk@Joe_Sepi Managed service on
 IBM Bluemix bluemix.net/openwhisk Delivered as
 Open source via Apache openwhisk.org Get started on Bluemix, or explore the open source project github.com/openwhisk slack.openwhisk.org twitter.com/openwhisk medium.com/openwhisk
  • 30. IBM Bluemix Apache OpenWhisk@Joe_Sepi See more sample apps on GitHub github.com/ibm Reach out to us team developer.ibm.com/code/work-with-us Or, work with an IBM Code developer advocate
  • 31. © 2017 IBM Corporation l Interconnect 2017 IBM Bluemix Apache OpenWhisk Building serverless applications with Apache OpenWhisk @Joe_Sepi Joe Sepi Developer Advocate, IBM