Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports...

50
Applications orientées événements et traitement sans serveur (“serverless”) Catherine Ezvan (@cezvan) Senior Certified IT Specialist IBM Cloud

Transcript of Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports...

Page 1: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

Applications orientées événements et traitement sans serveur (“serverless”)

Catherine Ezvan (@cezvan)Senior Certified IT SpecialistIBM Cloud

Page 2: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

2

Let’s talk about…

● Why we need event-driven infrastructure

● Requirements for event-driven infrastructure

● Introducing OpenWhisk

● Conclusion

Page 3: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

3

Welcome to Industrial internet!

Page 4: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

4

Devices can be...

Page 5: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

5

How would you implement it?

Page 6: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

6

OK, let’s move step by step

Page 7: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

7

And if you want it to be HA?

Page 8: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

8

What about another device?

Page 9: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

9

Let’s be smart!

Page 10: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

10

An unexpected spike!

Page 11: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

11

Scaling out!

Page 12: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

12

And traffic goes down...

Page 13: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

13

An excessive compute?

Page 14: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

14

Or maybe those ones?

Page 15: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

15

And in the meantime...

Page 16: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

16

And further down...

Page 17: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

17

And...

Page 18: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

18

One process, one container

Page 19: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

19

One process, one container

Page 20: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

20

But if we don’t scale fast...

How much does it cost?

Page 21: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

21

Ideal case

Page 22: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

22

Compute follows traffic

Page 23: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

23

Compute follows traffic

Page 24: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

24

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion

Page 25: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

25

So what are the requirements?

● Invoke and scale as fast as possible● Terminate after completion● Charge per compute used

Page 26: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 27: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 28: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 29: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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)

Page 30: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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)

Page 31: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 32: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 33: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 34: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 35: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 36: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 37: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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 …

Page 38: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 39: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 40: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

OpenWhisk in a nutshell

Trigger: „A class of events that can happen“T

Page 41: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

OpenWhisk in a nutshell

A Actions: „An event-handler, i.e. code that runs in response to an event“

Page 42: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 43: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

OpenWhisk in a nutshell

R

R := T A

Rules: „An association of a trigger and an action“

Page 44: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 45: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 46: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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/

Page 47: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

• 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?

Page 48: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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, …

Page 49: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

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

Page 50: Applications orientées événements et traitement …...Open (Apache 2) & open ecosystem Supports higher-level programming constructs(e.g. sequencing) Open interface for event providers

Thank you!

50

@cezvan