Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports...
Transcript of Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports...
Applications orientées événements et traitement sans serveur (“serverless”)
Catherine Ezvan (@cezvan)Senior Certified IT SpecialistIBM Cloud
2
Let’s talk about…
● Why we need event-driven infrastructure
● Requirements for event-driven infrastructure
● Introducing OpenWhisk
● Conclusion
3
Welcome to Industrial internet!
4
Devices can be...
5
How would you implement it?
6
OK, let’s move step by step
7
And if you want it to be HA?
8
What about another device?
9
Let’s be smart!
10
An unexpected spike!
11
Scaling out!
12
And traffic goes down...
13
An excessive compute?
14
Or maybe those ones?
15
And in the meantime...
16
And further down...
17
And...
18
One process, one container
19
One process, one container
20
But if we don’t scale fast...
How much does it cost?
21
Ideal case
22
Compute follows traffic
23
Compute follows traffic
24
So what are the requirements?
● Invoke and scale as fast as possible● Terminate after completion
25
So what are the requirements?
● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used
26
So what are the requirements?
● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing
27
So what are the requirements?
● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing
● Support of multiple technologies● Have possibility to launch other
microservices● Write and read data from multiple
data sources
28
So what are the requirements?
● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used● Guaranteed message delivery● Load balancing● High availability● Self-healing
● Support of multiple technologies● Have possibility to launch other
microservices● Write and read data from multiple
data sources● Abstract developers from the
infrastructure
29
OpenWhisk in a nutshell
„Event-action platform to execute code in response to events“
* whisk (v): to move nimbly and quickly (source: merriam-webster.com)
30
OpenWhisk in a nutshell
„Event-action platform to execute code in response to events“
Delivered as open source & managed service on IBM Bluemix
* whisk (v): to move nimbly and quickly (source: merriam-webster.com)
OpenWhisk in a nutshell
Swift
Application
Container VMCF
2
Polling
1b
Request
1a
Traditional model
• Continous polling due to missing event programming model
• Charges even when idling due to poor utilization
Process & idle
OpenWhisk in a nutshell
Swift
Application
Container VMCF
2
Polling
1b
Request
1a
Traditional model
• Continous polling due to missing event programming model
• Charges even when idling due to poor utilization
• Worry about scaling- When to scale? (mem-, cpu-, response time-driven)- How fast to scale?
Process & idle
OpenWhisk in a nutshell
Swift
Application
Container VMCF
2
Polling
1b
Request
1a
Traditional model
• Continous polling due to missing event programming model
• Charges even when idling due to poor utilization
• Worry about scaling- When to scale? (mem-, cpu-, response time-driven)- How fast to scale?
• Worry about resiliency- At least 2 processes for HA (driving cost)- Deployment in multiple regions (driving cost)- Keep them running & healthy
Process & idle
OpenWhisk in a nutshell
OpenWhisk
• Introduces event programming model• Charges only for what is used due to optimal
utilization Pool of actions
Swift DockerJS
Trigger
1
Running action
Running action
Running action
3
Deploy action within millisecs,run it, free up resources
OpenWhisk Engine
2
OpenWhisk in a nutshell
OpenWhisk
• Introduces event programming model• Charges only for what is used due to optimal
utilization
• Scales inherently- One process per request
Pool of actions
Swift DockerJS
Trigger
1
Running action
Running action
Running action
3
Deploy action within millisecs,run it, free up resources
OpenWhisk Engine
2
OpenWhisk in a nutshell
OpenWhisk
• Introduces event programming model• Charges only for what is used due to optimal
utilization
• Scales inherently- One process per request
• No cost overhead for resiliency- No long running process for HA
Pool of actions
Swift DockerJS
Trigger
1
Running action
Running action
Running action
3
Deploy action within millisecs,run it, free up resources
OpenWhisk Engine
2
OpenWhisk in a nutshell
} 1
Event Providers
OpenWhisk
NoSQL DB (ex. Cloudant)
Push Notifications
…
…
…
Data event occurs, e.g.-Commit on a Git Repository-CRUD operation on NoSQL DB (Cloudant)-….
Trigger execution of associated OpenWhisk action
2
…JS Swift Docker …
OpenWhisk in a nutshell
OpenWhisk
JS Swift Docker …
Incoming HTTP request, e.g.HTTP GET mynewcoolapp.com/customers
1 2 Invoke associated OpenWhisk action „getCustomers“
Browser
Mobile App
Web App
Variety of languages
OpenWhisk in a nutshell
• Services define the events they emit as triggers, and developers associate the actions to handle the events via rules
• The developer only needs to care about implementing the desired application logic - the system handles the rest
T R A
OpenWhisk in a nutshell
Trigger: „A class of events that can happen“T
OpenWhisk in a nutshell
A Actions: „An event-handler, i.e. code that runs in response to an event“
OpenWhisk in a nutshell
A
AA:= A1
+ A2+ A3
AB := A2+ A1
+ A3
AC:= A3
+ A1+ A2
Actions: Can be chained to create sequences to increase flexibility and foster reuse
OpenWhisk in a nutshell
R
R := T A
Rules: „An association of a trigger and an action“
OpenWhisk in a nutshell
myActionmyFeedT
A
Packages: „A shared collection of triggers and actions“P
A forecast
OpenSource YoursThird
Party
translatelanguageIdtextToSpeechA
AA
databaseCreatedocumentRead...changesT
AAA
Push Notifications
sendMessagewebhookT
A
webhookT
postA
WebsocketsendA
OpenWhisk in action, on Bluemix - Dark Vision by Fred Lavigne
45
1. User uploads video from mobile device2. Cloud (Watson services) analyze frames to detect
products, objects, faces, text3. Use results to deliver improved navigation,
recommendations, search
https://www.youtube.com/watch?v=1teIMpkI_Sg
You want to try OpenWhisk on your own?
• Want to try out our IBM Bluemix OpenWhisk offering?Sign-up today at: https://new-console.ng.bluemix.net/openwhisk/
• Want to try out our IBM Bluemix OpenWhisk offering?Sign-up today at: https://new-console.ng.bluemix.net/openwhisk/
• Want to try out our open-source OpenWhisk offering?Visit: https://developer.ibm.com/openwhisk/
You want to try OpenWhisk on your own?
48
OpenWhisk in a nutshell
Serverless deployment & operations model
Optimal utilization & granular pricing
Flexible programming model
Open (Apache 2) & open ecosystem
Supports higher-level programming constructs (e.g. sequencing)
Open interface for event providers
Scales on a per-request basis
Polyglot support
Rich set of services available in Bluemix (incl Watson)
Leverages Docker, Kafka, Consul, …
References• General Availability: What’s new in IBM Bluemix OpenWhisk?
• Articles, media and much more on Github Awesome OpenWhisk
• Press and analysts focusing on serverless:– The Wall Street Journal: Look Ma, No Server: Corporate IT
Expects ‘Serverless’ Computing to Trigger Big Changes– Forbes: Three Ways That "Serverless" Computing Will Transform
App Development In 2017– Forbes: Why Enterprises Should Care About Serverless Computing49
Thank you!
50
@cezvan