SlideShare ist ein Scribd-Unternehmen logo
1 von 103
Downloaden Sie, um offline zu lesen
© 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/

Weitere Àhnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019
 
JSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven worldJSpring Virtual 2020 - Reacting to an event-driven world
JSpring Virtual 2020 - Reacting to an event-driven world
 
"Developing with .NET Core on AWS", Martin Beeby, AWS Dev Day Kyiv 2019
"Developing with .NET Core on AWS", Martin Beeby, AWS Dev Day Kyiv 2019"Developing with .NET Core on AWS", Martin Beeby, AWS Dev Day Kyiv 2019
"Developing with .NET Core on AWS", Martin Beeby, AWS Dev Day Kyiv 2019
 
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019
 
CICDforModernApplications_Stockholm.pdf
CICDforModernApplications_Stockholm.pdfCICDforModernApplications_Stockholm.pdf
CICDforModernApplications_Stockholm.pdf
 
Kubernetes - 7 lessons learned from 7 data centers in 7 months
Kubernetes - 7 lessons learned from 7 data centers in 7 monthsKubernetes - 7 lessons learned from 7 data centers in 7 months
Kubernetes - 7 lessons learned from 7 data centers in 7 months
 
2012 05 confess_camel_cloud_integration
2012 05 confess_camel_cloud_integration2012 05 confess_camel_cloud_integration
2012 05 confess_camel_cloud_integration
 
Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...
Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...
Kubernetes for Developers - 7 lessons learned from 7 data centers in 7 months...
 
20190205 AWS Black Belt Online Seminar ć…Źć…±æ©Ÿé–ąă«ă‚ˆă‚‹AWSăźćˆ©æŽ»ç”š
20190205 AWS Black Belt Online Seminar ć…Źć…±æ©Ÿé–ąă«ă‚ˆă‚‹AWSăźćˆ©æŽ»ç”š20190205 AWS Black Belt Online Seminar ć…Źć…±æ©Ÿé–ąă«ă‚ˆă‚‹AWSăźćˆ©æŽ»ç”š
20190205 AWS Black Belt Online Seminar ć…Źć…±æ©Ÿé–ąă«ă‚ˆă‚‹AWSăźćˆ©æŽ»ç”š
 
DevOps on AWS: A Practical Introduction
DevOps on AWS: A Practical IntroductionDevOps on AWS: A Practical Introduction
DevOps on AWS: A Practical Introduction
 
EMCW2015 - Containers vs VMs
EMCW2015 - Containers vs VMsEMCW2015 - Containers vs VMs
EMCW2015 - Containers vs VMs
 
EMC World 2015 - EMC {code} Photo Booth Presentation
EMC World 2015 - EMC {code} Photo Booth PresentationEMC World 2015 - EMC {code} Photo Booth Presentation
EMC World 2015 - EMC {code} Photo Booth Presentation
 
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
Bluemix overview - Rencontres Ecole Centrale et Supelec avec IBM France Lab -...
 
DevNexus - Reacting to an event driven world
DevNexus - Reacting to an event driven worldDevNexus - Reacting to an event driven world
DevNexus - Reacting to an event driven world
 
EMCW2015 - Containers and Data Persistence
EMCW2015 - Containers and Data PersistenceEMCW2015 - Containers and Data Persistence
EMCW2015 - Containers and Data Persistence
 
Well-Architected ăƒ•ăƒŹăƒŒăƒ ăƒŻăƒŒă‚ŻæŠ‚èŠ
Well-Architected ăƒ•ăƒŹăƒŒăƒ ăƒŻăƒŒă‚ŻæŠ‚èŠWell-Architected ăƒ•ăƒŹăƒŒăƒ ăƒŻăƒŒă‚ŻæŠ‚èŠ
Well-Architected ăƒ•ăƒŹăƒŒăƒ ăƒŻăƒŒă‚ŻæŠ‚èŠ
 
EMC World 2015 - The Devops Toolkit
EMC World 2015 - The Devops ToolkitEMC World 2015 - The Devops Toolkit
EMC World 2015 - The Devops Toolkit
 
All you know about ASP.NET deployment is wrong!
All you know about ASP.NET deployment is wrong!All you know about ASP.NET deployment is wrong!
All you know about ASP.NET deployment is wrong!
 
EMC World 2015 - Why DevOps is Critical for Business
EMC World 2015 -  Why DevOps is Critical for BusinessEMC World 2015 -  Why DevOps is Critical for Business
EMC World 2015 - Why DevOps is Critical for Business
 
How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?How do you deliver your applications to the cloud?
How do you deliver your applications to the cloud?
 

Ähnlich wie An intro to serverless and OpenWhisk for Kafka users

DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
Amazon Web Services
 

Ähnlich wie An intro to serverless and OpenWhisk for Kafka users (20)

AWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the CloudAWS Accra Meetup - Developing Modern Applications in the Cloud
AWS Accra Meetup - Developing Modern Applications in the Cloud
 
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud[CPT DevOps Meetup] Developing Modern Applications in the Cloud
[CPT DevOps Meetup] Developing Modern Applications in the Cloud
 
AWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the CloudAWS Jozi Meetup Developing Modern Applications in the Cloud
AWS Jozi Meetup Developing Modern Applications in the Cloud
 
CICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdfCICDforModernApplications-Oslo.pdf
CICDforModernApplications-Oslo.pdf
 
Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...
Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...
Codemotion Berlin 2017 - Event-driven and serverless applications with IBM Cl...
 
Containers on AWS
Containers on AWSContainers on AWS
Containers on AWS
 
DevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon WayDevOps - Moving to DevOps the Amazon Way
DevOps - Moving to DevOps the Amazon Way
 
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World ScenariosIBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
IBM Cloud Private and IBM Power Systems: Overview and Real-World Scenarios
 
DevConZM - Modern Applications Development in the Cloud
DevConZM - Modern Applications Development in the CloudDevConZM - Modern Applications Development in the Cloud
DevConZM - Modern Applications Development in the Cloud
 
CI/CD for Modern Applications
CI/CD for Modern ApplicationsCI/CD for Modern Applications
CI/CD for Modern Applications
 
Breaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container ServicesBreaking the Monolith Using AWS Container Services
Breaking the Monolith Using AWS Container Services
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
Breaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdfBreaking the Monolith road to containers.pdf
Breaking the Monolith road to containers.pdf
 
Kafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical PresentationKafka with IBM Event Streams - Technical Presentation
Kafka with IBM Event Streams - Technical Presentation
 
Open by Design: Accelerating the Enterprise Cloud Journey - DEM02-S - Anaheim...
Open by Design: Accelerating the Enterprise Cloud Journey - DEM02-S - Anaheim...Open by Design: Accelerating the Enterprise Cloud Journey - DEM02-S - Anaheim...
Open by Design: Accelerating the Enterprise Cloud Journey - DEM02-S - Anaheim...
 
AWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applicationsAWS DevDay Cologne - CI/CD for modern applications
AWS DevDay Cologne - CI/CD for modern applications
 
Cloud Migration Workshop
Cloud Migration WorkshopCloud Migration Workshop
Cloud Migration Workshop
 
Open by design: Accelerating the enterprise cloud journey - DEM01-S - New Yor...
Open by design: Accelerating the enterprise cloud journey - DEM01-S - New Yor...Open by design: Accelerating the enterprise cloud journey - DEM01-S - New Yor...
Open by design: Accelerating the enterprise cloud journey - DEM01-S - New Yor...
 
Developing Intelligent Robots with AWS RoboMaker - SVC205 - Anaheim AWS Summit
Developing Intelligent Robots with AWS RoboMaker - SVC205 - Anaheim AWS SummitDeveloping Intelligent Robots with AWS RoboMaker - SVC205 - Anaheim AWS Summit
Developing Intelligent Robots with AWS RoboMaker - SVC205 - Anaheim AWS Summit
 
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
Deploy and scale your first cloud application with Amazon Lightsail - CMP202 ...
 

Mehr von Dale Lane

Debugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile DevicesDebugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile Devices
Dale Lane
 

Mehr von Dale Lane (20)

Describing Kafka security in AsyncAPI
Describing Kafka security in AsyncAPIDescribing Kafka security in AsyncAPI
Describing Kafka security in AsyncAPI
 
Our NASA Space Apps Challenge 2019 entry
Our NASA Space Apps Challenge 2019 entryOur NASA Space Apps Challenge 2019 entry
Our NASA Space Apps Challenge 2019 entry
 
Useful Kafka tools
Useful Kafka toolsUseful Kafka tools
Useful Kafka tools
 
How to increase the social impact you make
How to increase the social impact you makeHow to increase the social impact you make
How to increase the social impact you make
 
Introducing Machine Learning to Kids
Introducing Machine Learning to KidsIntroducing Machine Learning to Kids
Introducing Machine Learning to Kids
 
Introducing machine learning to kids
Introducing machine learning to kidsIntroducing machine learning to kids
Introducing machine learning to kids
 
Small Spaces, Big Ideas - our Space Apps Challenge
Small Spaces, Big Ideas - our Space Apps ChallengeSmall Spaces, Big Ideas - our Space Apps Challenge
Small Spaces, Big Ideas - our Space Apps Challenge
 
Owls
OwlsOwls
Owls
 
The skills implications of Cognitive Computing
The skills implications of Cognitive ComputingThe skills implications of Cognitive Computing
The skills implications of Cognitive Computing
 
Conversational Internet - Creating a natural language interface for web pages
Conversational Internet - Creating a natural language interface for web pagesConversational Internet - Creating a natural language interface for web pages
Conversational Internet - Creating a natural language interface for web pages
 
Debugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile DevicesDebugging Web Apps on Real Mobile Devices
Debugging Web Apps on Real Mobile Devices
 
GaianDB
GaianDBGaianDB
GaianDB
 
Pushing, pulling or leaving the door open
Pushing, pulling or leaving the door openPushing, pulling or leaving the door open
Pushing, pulling or leaving the door open
 
Push notifications
Push notificationsPush notifications
Push notifications
 
Fire Eagle Guest Pass
Fire Eagle Guest PassFire Eagle Guest Pass
Fire Eagle Guest Pass
 
Monitoring your electricity usage
Monitoring your electricity usageMonitoring your electricity usage
Monitoring your electricity usage
 
CurrentCost
CurrentCostCurrentCost
CurrentCost
 
An introduction to Windows Mobile development
An introduction to Windows Mobile developmentAn introduction to Windows Mobile development
An introduction to Windows Mobile development
 
An Introduction to Windows PowerShell
An Introduction to Windows PowerShellAn Introduction to Windows PowerShell
An Introduction to Windows PowerShell
 
Mowing the lawn
Mowing the lawnMowing the lawn
Mowing the lawn
 

KĂŒrzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

KĂŒrzlich hochgeladen (20)

Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

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/