SlideShare a Scribd company logo
© 2019 IBM Corporation
Building serverless apps with Kafka
Dale Lane
An introduction to serverless with Apache OpenWhisk
IBM Event StreamsApache Kafka
@dalelane
© 2019 IBM Corporation
Agenda
§ What is “serverless”?
§ Implementations
§ Apache OpenWhisk
§ Demos
© 2019 IBM Corporation
What is “serverless”?
© 2019 IBM Corporation
Serverless
§An architectural pattern where your code is run:
– in response to events
– only on-demand on a per-request basis
© 2019 IBM Corporation
Evolution of deployment patterns
Monolith
© 2019 IBM Corporation
Evolution of deployment patterns
Microservice
Microservice
Microservice
Monolith
© 2019 IBM Corporation
Evolution of deployment patterns
Function
Function
Function
Function
Function
Function
Function
Function
Microservice
Microservice
Microservice
Monolith
© 2019 IBM Corporation
Evolution of deployment patterns
Bare metal Virtual
machines
Containers Orchestration Serverless
© 2019 IBM Corporation
Function
FaaS
Platform
PaaS
Infrastructure
IaaS
Container
CaaS
Bare metal
Evolution of deployment patterns
© 2019 IBM Corporation
Definition
github.com/cncf/wg-serverless
© 2019 IBM Corporation
Definition
github.com/cncf/wg-serverless
© 2019 IBM Corporation
Definition
applications that do not require server management
applications bundled as one or more functions
[developers] no longer need to spend time and resources on server
provisioning, maintenance, updates, scaling and capacity planning
© 2019 IBM Corporation
How is serverless different?
Monolith Microservice
Microservice
Microservice
Function
Function
Function
Function
Function
Function
Function
Function
© 2019 IBM Corporation
How is serverless different?
© 2019 IBM Corporation
How is serverless different?
© 2019 IBM Corporation
How is serverless different?
£ $ €
kr Fr
¥
© 2019 IBM Corporation
Example use cases
§ Event processing
§ Data processing
§ Scheduled tasks
§ Scalable REST APIs
© 2019 IBM Corporation
The Twelve Factor App
© 2019 IBM Corporation
Serverless is good for:
§ Infrequent or sporadic demand
§ Focused, short duration processing
§ Highly dynamic workloads
§ Stateless workloads
§ Inconsistent demand
§ Scheduled infrequent tasks
§ Flexibility
© 2019 IBM Corporation
Implementations
© 2019 IBM Corporation
Implementations – platform
© 2019 IBM Corporation
Implementations – platform
© 2019 IBM Corporation
Implementations – platform
© 2019 IBM Corporation
Implementations – platform
© 2019 IBM Corporation
Implementations – platform
© 2019 IBM Corporation
Implementations – hosted
© 2019 IBM Corporation
Implementations – private cloud
© 2019 IBM Corporation
Implementations – installable
© 2019 IBM Corporation
Implementations
s.cncf.io
© 2019 IBM Corporation
Serverless framework
serverless.com/framework
© 2019 IBM Corporation
Apache OpenWhisk
© 2019 IBM Corporation
OpenWhisk
openwhisk.apache.org
© 2019 IBM Corporation
OpenWhisk – who
© 2019 IBM Corporation
OpenWhisk – where
© 2019 IBM Corporation
OpenWhisk concepts
© 2019 IBM Corporation
OpenWhisk concepts
event
© 2019 IBM Corporation
OpenWhisk concepts
event action
© 2019 IBM Corporation
OpenWhisk concepts
event action
function (eventobj)
{
// do something
return result;
}
© 2019 IBM Corporation
OpenWhisk languages
© 2019 IBM Corporation
OpenWhisk languages
© 2019 IBM Corporation
OpenWhisk concepts
event action
© 2019 IBM Corporation
OpenWhisk concepts
event actiontrigger
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
© 2019 IBM Corporation
OpenWhisk concepts
actionrule
event
actionrule
actionrule
actionrule
trigger
© 2019 IBM Corporation
OpenWhisk concepts
rule
event
rule
rule
rule
trigger
trigger
trigger
trigger
action
event
event
event
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
function main(params) {
return { hello : 'world' };
} hello.js
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
function main(params) {
return { hello : 'world' };
} hello.js
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
function main(params) {
return { hello : 'world' };
}
$ wsk action create helloworld hello.js
ok: created action helloworld
hello.js
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
function main(params) {
return { hello : 'world' };
}
$ wsk action create helloworld hello.js
ok: created action helloworld
$ wsk action invoke helloworld
ok: invoked /guest/helloworld with id 7df9c9dfbb
hello.js
© 2019 IBM Corporation
OpenWhisk actions
blocking
non-blocking
© 2019 IBM Corporation
OpenWhisk actions
blocking
non-blocking
periodic
© 2019 IBM Corporation
OpenWhisk actions
action action action
© 2019 IBM Corporation
OpenWhisk concepts
actiontrigger ruleevent
© 2019 IBM Corporation
OpenWhisk implementation
proxy
© 2019 IBM Corporation
OpenWhisk implementation
proxy controller
© 2019 IBM Corporation
OpenWhisk implementation
proxy controller
store
© 2019 IBM Corporation
OpenWhisk implementation
proxy controller
store
service registry
invoker
© 2019 IBM Corporation
OpenWhisk implementation
proxy controller
store
service registry
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
OpenWhisk implementation
controller
invoker
invoker
invoker
invoker
invoker
invoker
© 2019 IBM Corporation
Container management
start X
init X X
run X X X
medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
© 2019 IBM Corporation
Container management
start X
init X X
run X X X
medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
© 2019 IBM Corporation
Container management
start X
init X X
run X X X
medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
© 2019 IBM Corporation
Resource limits
github.com/apache/incubator-openwhisk
© 2019 IBM Corporation
Demos – installable
© 2019 IBM Corporation
Deployment options
© 2019 IBM Corporation
git clone https://github.com/apache/incubator-openwhisk-devtools.git
cd incubator-openwhisk-devtools/docker-compose
make quick-start
© 2019 IBM Corporation
OpenWhisk event providers
trigger ruleevent
© 2019 IBM Corporation
cd incubator-openwhisk-devtools/docker-compose
make create-provider-cloudant
make create-provider-kafka
© 2019 IBM Corporation
git clone https://github.com/apache/incubator-openwhisk-package-kafka.git
cd incubator-openwhisk-package-kafka
export OPENWHISK_AUTH=$OPENWHISK_HOME/ansible/files/auth.whisk.system
./installKafka.sh $OPENWHISK_AUTH $SYSTEM_IP_ADDR 
http://$SYSTEM_IP_ADDR:5984 
local_ 
$SYSTEM_IP_ADDR
© 2019 IBM Corporation
Demo
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
© 2019 IBM Corporation
kafka-topics.sh --create --topic MY.EVENTS 
--replication-factor 1 --partitions 1 
--zookeeper $SYSTEM_IP_ADDR:3181
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
© 2019 IBM Corporation
wsk trigger create myKafkaTrigger 
-f /whisk.system/messaging/kafkaFeed 
-p brokers '["9.174.23.208:3092"]' 
-p topic MY.EVENTS
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
sendToSlack
action
action
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
sendToSlack
action
action
© 2019 IBM Corporation
wsk action create sendToSlack slack-action.js
© 2019 IBM Corporation
Demo
event
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
sendToSlack
action
action
© 2019 IBM Corporation
Demo
ruleevent
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
slackOnKafkaMessages
sendToSlack
action
action
© 2019 IBM Corporation
wsk rule create slackOnKafkaMessages 
myKafkaTrigger 
sendToSlack
© 2019 IBM Corporation
Demo
ruleevent
Message
produced to
Kafka topic
MY.EVENTS
myKafkaTrigger
trigger
slackOnKafkaMessages
sendToSlack
action
action
© 2019 IBM Corporation
© 2019 IBM Corporation
Reminder
© 2019 IBM Corporation
Demos – using a hosted service
© 2019 IBM Corporation
Demo
Orders Voyages Ships Containers Alerts
VoyagesOrder
Order
Management
Microservice
Fleet/Ships
Simulator
Microservice
Voyages
Management
Microservice
Kafka Streams
Kafka
© 2019 IBM Corporation
© 2019 IBM Corporation
Demo
© 2019 IBM Corporation
Demo
ruleevent
Message
produced to
Kafka topic
“alerts”
kafkaAlert
trigger
processAlert
action
action
© 2019 IBM Corporation
© 2019 IBM Corporation
Demo
ruleevent
Message
produced to
Kafka topic
“alerts”
kafkaAlert
trigger
processAlert
action
action
© 2019 IBM Corporation
Orders Voyages Ships Containers Alerts
VoyagesOrder
Order
Management
Microservice
Fleet/Ships
Simulator
Microservice
Voyages
Management
Microservice
Kafka
Kafka Streams
© 2019 IBM Corporation
Summary
© 2019 IBM Corporation
Summary / roundup
§An architectural pattern where your code is run:
– in response to events
– only on-demand on a per-request basis
© 2019 IBM Corporation
Getting started
twitter.com/openwhisk
medium.com/openwhisk
slack.openwhisk.org
youtube.com/channel/UCbzgShnQk8F43NKsvEYA1SA
#openwhisk
developer.ibm.com/code/patterns/category/serverless
serverlessconf.io
© 2019 IBM Corporation
Thank you
Dale Lane
Software Engineer, IBM Event Streams
IBM Event Streams - ibm.com/cloud/event-streams
https://slack-invite-ibm-cloud-tech.mybluemix.net/

More Related Content

What's hot (16)

PDF
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
Bhuvaneswari Subramani
 
PPTX
Kubernetes - 7 lessons learned from 7 data centers in 7 months
Michael Tougeron
 
PDF
2012 05 confess_camel_cloud_integration
Kai Wähner
 
PPTX
Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...
Michael Tougeron
 
PDF
20190205 AWS Black Belt Online Seminar 公共機関によるAWSの利活用
Amazon Web Services Japan
 
PDF
DevOps on AWS: A Practical Introduction
aledsage
 
PPTX
EMCW2015 - Containers vs VMs
Clinton Kitson
 
PPTX
EMC World 2015 - EMC {code} Photo Booth Presentation
Kendrick Coleman
 
PDF
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Yves LE CLEACH
 
PPTX
DevNexus - Reacting to an event driven world
Grace Jansen
 
PPTX
EMCW2015 - Containers and Data Persistence
Clinton Kitson
 
PDF
Well-Architected フレームワーク概要
淳 千葉
 
PPTX
EMC World 2015 - The Devops Toolkit
Jonas Rosland
 
PPTX
All you know about ASP.NET deployment is wrong!
Roger Pence
 
PPTX
EMC World 2015 - Why DevOps is Critical for Business
Brian Gracely
 
PDF
How do you deliver your applications to the cloud?
Michael Elder
 
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
Bhuvaneswari Subramani
 
Kubernetes - 7 lessons learned from 7 data centers in 7 months
Michael Tougeron
 
2012 05 confess_camel_cloud_integration
Kai Wähner
 
Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...
Michael Tougeron
 
20190205 AWS Black Belt Online Seminar 公共機関によるAWSの利活用
Amazon Web Services Japan
 
DevOps on AWS: A Practical Introduction
aledsage
 
EMCW2015 - Containers vs VMs
Clinton Kitson
 
EMC World 2015 - EMC {code} Photo Booth Presentation
Kendrick Coleman
 
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Yves LE CLEACH
 
DevNexus - Reacting to an event driven world
Grace Jansen
 
EMCW2015 - Containers and Data Persistence
Clinton Kitson
 
Well-Architected フレームワーク概要
淳 千葉
 
EMC World 2015 - The Devops Toolkit
Jonas Rosland
 
All you know about ASP.NET deployment is wrong!
Roger Pence
 
EMC World 2015 - Why DevOps is Critical for Business
Brian Gracely
 
How do you deliver your applications to the cloud?
Michael Elder
 

Similar to An intro to serverless and OpenWhisk for Kafka users (18)

PPTX
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
PPTX
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
PPTX
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
PDF
Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...
Frederic Lavigne
 
PDF
Containers on AWS
Reham Maher El-Safarini
 
PDF
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
Joe Cropper
 
PPTX
DevConZM - Modern Applications Development in the Cloud
Cobus Bernard
 
PDF
Kafka with IBM Event Streams - Technical Presentation
Winton Winton
 
PPTX
AWS DevDay Cologne - CI/CD for modern applications
Cobus Bernard
 
PDF
IBM Think 2019 session 2116 - Best practices for operating and managing a pro...
Hendrik van Run
 
PPTX
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
IBM France Lab
 
PDF
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
OpenWhisk
 
PPTX
Virtual Meetup Sweden - Reacting to an event driven world
Grace Jansen
 
PPTX
Octobus technical university def
Daniela Zuppini
 
PDF
NRB - BE MAINFRAME DAY 2017 - IBM Z
NRB
 
PDF
NRB - LUXEMBOURG MAINFRAME DAY 2017 - IBM Z
NRB
 
PDF
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
PDF
App Modernization
PT Datacomm Diangraha
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
Cobus Bernard
 
AWS Accra Meetup - Developing Modern Applications in the Cloud
Cobus Bernard
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
Cobus Bernard
 
Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...
Frederic Lavigne
 
Containers on AWS
Reham Maher El-Safarini
 
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
Joe Cropper
 
DevConZM - Modern Applications Development in the Cloud
Cobus Bernard
 
Kafka with IBM Event Streams - Technical Presentation
Winton Winton
 
AWS DevDay Cologne - CI/CD for modern applications
Cobus Bernard
 
IBM Think 2019 session 2116 - Best practices for operating and managing a pro...
Hendrik van Run
 
IBM Bluemix Paris Meetup #22-20170315 Meetup @VillagebyCA - Serverless & Open...
IBM France Lab
 
IBM Bluemix OpenWhisk: Serverless Conference 2017, Austin, USA: Keynote
OpenWhisk
 
Virtual Meetup Sweden - Reacting to an event driven world
Grace Jansen
 
Octobus technical university def
Daniela Zuppini
 
NRB - BE MAINFRAME DAY 2017 - IBM Z
NRB
 
NRB - LUXEMBOURG MAINFRAME DAY 2017 - IBM Z
NRB
 
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
App Modernization
PT Datacomm Diangraha
 
Ad

More from Dale Lane (20)

PDF
Describing Kafka security in AsyncAPI
Dale Lane
 
PDF
Our NASA Space Apps Challenge 2019 entry
Dale Lane
 
PDF
Useful Kafka tools
Dale Lane
 
PDF
How to increase the social impact you make
Dale Lane
 
PDF
Introducing Machine Learning to Kids
Dale Lane
 
PDF
Introducing machine learning to kids
Dale Lane
 
PPTX
Small Spaces, Big Ideas - our Space Apps Challenge
Dale Lane
 
PDF
Owls
Dale Lane
 
PDF
The skills implications of Cognitive Computing
Dale Lane
 
PDF
Conversational Internet - Creating a natural language interface for web pages
Dale Lane
 
PDF
Debugging Web Apps on Real Mobile Devices
Dale Lane
 
PDF
GaianDB
Dale Lane
 
PPT
Pushing, pulling or leaving the door open
Dale Lane
 
PDF
Push notifications
Dale Lane
 
PPT
Fire Eagle Guest Pass
Dale Lane
 
PDF
Monitoring your electricity usage
Dale Lane
 
PPT
CurrentCost
Dale Lane
 
PPT
An introduction to Windows Mobile development
Dale Lane
 
ODP
An Introduction to Windows PowerShell
Dale Lane
 
PPT
Mowing the lawn
Dale Lane
 
Describing Kafka security in AsyncAPI
Dale Lane
 
Our NASA Space Apps Challenge 2019 entry
Dale Lane
 
Useful Kafka tools
Dale Lane
 
How to increase the social impact you make
Dale Lane
 
Introducing Machine Learning to Kids
Dale Lane
 
Introducing machine learning to kids
Dale Lane
 
Small Spaces, Big Ideas - our Space Apps Challenge
Dale Lane
 
Owls
Dale Lane
 
The skills implications of Cognitive Computing
Dale Lane
 
Conversational Internet - Creating a natural language interface for web pages
Dale Lane
 
Debugging Web Apps on Real Mobile Devices
Dale Lane
 
GaianDB
Dale Lane
 
Pushing, pulling or leaving the door open
Dale Lane
 
Push notifications
Dale Lane
 
Fire Eagle Guest Pass
Dale Lane
 
Monitoring your electricity usage
Dale Lane
 
CurrentCost
Dale Lane
 
An introduction to Windows Mobile development
Dale Lane
 
An Introduction to Windows PowerShell
Dale Lane
 
Mowing the lawn
Dale Lane
 
Ad

Recently uploaded (20)

PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
July Patch Tuesday
Ivanti
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
PDF
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
July Patch Tuesday
Ivanti
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
What Makes Contify’s News API Stand Out: Key Features at a Glance
Contify
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 

An intro to serverless and OpenWhisk for Kafka users

  • 1. © 2019 IBM Corporation Building serverless apps with Kafka Dale Lane An introduction to serverless with Apache OpenWhisk IBM Event StreamsApache Kafka @dalelane
  • 2. © 2019 IBM Corporation Agenda § What is “serverless”? § Implementations § Apache OpenWhisk § Demos
  • 3. © 2019 IBM Corporation What is “serverless”?
  • 4. © 2019 IBM Corporation Serverless §An architectural pattern where your code is run: – in response to events – only on-demand on a per-request basis
  • 5. © 2019 IBM Corporation Evolution of deployment patterns Monolith
  • 6. © 2019 IBM Corporation Evolution of deployment patterns Microservice Microservice Microservice Monolith
  • 7. © 2019 IBM Corporation Evolution of deployment patterns Function Function Function Function Function Function Function Function Microservice Microservice Microservice Monolith
  • 8. © 2019 IBM Corporation Evolution of deployment patterns Bare metal Virtual machines Containers Orchestration Serverless
  • 9. © 2019 IBM Corporation Function FaaS Platform PaaS Infrastructure IaaS Container CaaS Bare metal Evolution of deployment patterns
  • 10. © 2019 IBM Corporation Definition github.com/cncf/wg-serverless
  • 11. © 2019 IBM Corporation Definition github.com/cncf/wg-serverless
  • 12. © 2019 IBM Corporation Definition applications that do not require server management applications bundled as one or more functions [developers] no longer need to spend time and resources on server provisioning, maintenance, updates, scaling and capacity planning
  • 13. © 2019 IBM Corporation How is serverless different? Monolith Microservice Microservice Microservice Function Function Function Function Function Function Function Function
  • 14. © 2019 IBM Corporation How is serverless different?
  • 15. © 2019 IBM Corporation How is serverless different?
  • 16. © 2019 IBM Corporation How is serverless different? £ $ € kr Fr ¥
  • 17. © 2019 IBM Corporation Example use cases § Event processing § Data processing § Scheduled tasks § Scalable REST APIs
  • 18. © 2019 IBM Corporation The Twelve Factor App
  • 19. © 2019 IBM Corporation Serverless is good for: § Infrequent or sporadic demand § Focused, short duration processing § Highly dynamic workloads § Stateless workloads § Inconsistent demand § Scheduled infrequent tasks § Flexibility
  • 20. © 2019 IBM Corporation Implementations
  • 21. © 2019 IBM Corporation Implementations – platform
  • 22. © 2019 IBM Corporation Implementations – platform
  • 23. © 2019 IBM Corporation Implementations – platform
  • 24. © 2019 IBM Corporation Implementations – platform
  • 25. © 2019 IBM Corporation Implementations – platform
  • 26. © 2019 IBM Corporation Implementations – hosted
  • 27. © 2019 IBM Corporation Implementations – private cloud
  • 28. © 2019 IBM Corporation Implementations – installable
  • 29. © 2019 IBM Corporation Implementations s.cncf.io
  • 30. © 2019 IBM Corporation Serverless framework serverless.com/framework
  • 31. © 2019 IBM Corporation Apache OpenWhisk
  • 32. © 2019 IBM Corporation OpenWhisk openwhisk.apache.org
  • 33. © 2019 IBM Corporation OpenWhisk – who
  • 34. © 2019 IBM Corporation OpenWhisk – where
  • 35. © 2019 IBM Corporation OpenWhisk concepts
  • 36. © 2019 IBM Corporation OpenWhisk concepts event
  • 37. © 2019 IBM Corporation OpenWhisk concepts event action
  • 38. © 2019 IBM Corporation OpenWhisk concepts event action function (eventobj) { // do something return result; }
  • 39. © 2019 IBM Corporation OpenWhisk languages
  • 40. © 2019 IBM Corporation OpenWhisk languages
  • 41. © 2019 IBM Corporation OpenWhisk concepts event action
  • 42. © 2019 IBM Corporation OpenWhisk concepts event actiontrigger
  • 43. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent
  • 44. © 2019 IBM Corporation OpenWhisk concepts actionrule event actionrule actionrule actionrule trigger
  • 45. © 2019 IBM Corporation OpenWhisk concepts rule event rule rule rule trigger trigger trigger trigger action event event event
  • 46. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } hello.js
  • 47. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } hello.js
  • 48. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } $ wsk action create helloworld hello.js ok: created action helloworld hello.js
  • 49. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent function main(params) { return { hello : 'world' }; } $ wsk action create helloworld hello.js ok: created action helloworld $ wsk action invoke helloworld ok: invoked /guest/helloworld with id 7df9c9dfbb hello.js
  • 50. © 2019 IBM Corporation OpenWhisk actions blocking non-blocking
  • 51. © 2019 IBM Corporation OpenWhisk actions blocking non-blocking periodic
  • 52. © 2019 IBM Corporation OpenWhisk actions action action action
  • 53. © 2019 IBM Corporation OpenWhisk concepts actiontrigger ruleevent
  • 54. © 2019 IBM Corporation OpenWhisk implementation proxy
  • 55. © 2019 IBM Corporation OpenWhisk implementation proxy controller
  • 56. © 2019 IBM Corporation OpenWhisk implementation proxy controller store
  • 57. © 2019 IBM Corporation OpenWhisk implementation proxy controller store service registry invoker
  • 58. © 2019 IBM Corporation OpenWhisk implementation proxy controller store service registry invoker invoker invoker invoker invoker invoker
  • 59. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 60. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 61. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 62. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 63. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 64. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 65. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 66. © 2019 IBM Corporation OpenWhisk implementation controller invoker invoker invoker invoker invoker invoker
  • 67. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  • 68. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  • 69. © 2019 IBM Corporation Container management start X init X X run X X X medium.com/openwhisk/squeezing-the-milliseconds-how-to-make-serverless-platforms-blazing-fast-aea0e9951bd0
  • 70. © 2019 IBM Corporation Resource limits github.com/apache/incubator-openwhisk
  • 71. © 2019 IBM Corporation Demos – installable
  • 72. © 2019 IBM Corporation Deployment options
  • 73. © 2019 IBM Corporation git clone https://github.com/apache/incubator-openwhisk-devtools.git cd incubator-openwhisk-devtools/docker-compose make quick-start
  • 74. © 2019 IBM Corporation OpenWhisk event providers trigger ruleevent
  • 75. © 2019 IBM Corporation cd incubator-openwhisk-devtools/docker-compose make create-provider-cloudant make create-provider-kafka
  • 76. © 2019 IBM Corporation git clone https://github.com/apache/incubator-openwhisk-package-kafka.git cd incubator-openwhisk-package-kafka export OPENWHISK_AUTH=$OPENWHISK_HOME/ansible/files/auth.whisk.system ./installKafka.sh $OPENWHISK_AUTH $SYSTEM_IP_ADDR http://$SYSTEM_IP_ADDR:5984 local_ $SYSTEM_IP_ADDR
  • 77. © 2019 IBM Corporation Demo
  • 78. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS
  • 79. © 2019 IBM Corporation kafka-topics.sh --create --topic MY.EVENTS --replication-factor 1 --partitions 1 --zookeeper $SYSTEM_IP_ADDR:3181
  • 80. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger
  • 81. © 2019 IBM Corporation wsk trigger create myKafkaTrigger -f /whisk.system/messaging/kafkaFeed -p brokers '["9.174.23.208:3092"]' -p topic MY.EVENTS
  • 82. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger
  • 83. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  • 84. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  • 85. © 2019 IBM Corporation wsk action create sendToSlack slack-action.js
  • 86. © 2019 IBM Corporation Demo event Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger sendToSlack action action
  • 87. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger slackOnKafkaMessages sendToSlack action action
  • 88. © 2019 IBM Corporation wsk rule create slackOnKafkaMessages myKafkaTrigger sendToSlack
  • 89. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic MY.EVENTS myKafkaTrigger trigger slackOnKafkaMessages sendToSlack action action
  • 90. © 2019 IBM Corporation
  • 91. © 2019 IBM Corporation Reminder
  • 92. © 2019 IBM Corporation Demos – using a hosted service
  • 93. © 2019 IBM Corporation Demo Orders Voyages Ships Containers Alerts VoyagesOrder Order Management Microservice Fleet/Ships Simulator Microservice Voyages Management Microservice Kafka Streams Kafka
  • 94. © 2019 IBM Corporation
  • 95. © 2019 IBM Corporation Demo
  • 96. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic “alerts” kafkaAlert trigger processAlert action action
  • 97. © 2019 IBM Corporation
  • 98. © 2019 IBM Corporation Demo ruleevent Message produced to Kafka topic “alerts” kafkaAlert trigger processAlert action action
  • 99. © 2019 IBM Corporation Orders Voyages Ships Containers Alerts VoyagesOrder Order Management Microservice Fleet/Ships Simulator Microservice Voyages Management Microservice Kafka Kafka Streams
  • 100. © 2019 IBM Corporation Summary
  • 101. © 2019 IBM Corporation Summary / roundup §An architectural pattern where your code is run: – in response to events – only on-demand on a per-request basis
  • 102. © 2019 IBM Corporation Getting started twitter.com/openwhisk medium.com/openwhisk slack.openwhisk.org youtube.com/channel/UCbzgShnQk8F43NKsvEYA1SA #openwhisk developer.ibm.com/code/patterns/category/serverless serverlessconf.io
  • 103. © 2019 IBM Corporation Thank you Dale Lane Software Engineer, IBM Event Streams IBM Event Streams - ibm.com/cloud/event-streams https://slack-invite-ibm-cloud-tech.mybluemix.net/