A RESTful API for Controlling Dynamic Streaming Topologies

139
A RESTful API for Controlling Dynamic Streaming Topologies Masiar Babazadeh University of Lugano Switzerland @ masiarb Cesare Pautasso University of Lugano Switzerland @pautasso 1

description

A RESTful API for Controlling Dynamic Streaming Topologies, presented at the WS-REST 2014 Workshop.

Transcript of A RESTful API for Controlling Dynamic Streaming Topologies

Page 1: A RESTful API for Controlling Dynamic Streaming Topologies

A RESTful API for Controlling Dynamic Streaming TopologiesMasiar Babazadeh!University of Lugano Switzerland @masiarb

Cesare Pautasso!University of Lugano Switzerland @pautasso

1

Page 2: A RESTful API for Controlling Dynamic Streaming Topologies

2

F

CP

F

F

Page 3: A RESTful API for Controlling Dynamic Streaming Topologies

3

P

Page 4: A RESTful API for Controlling Dynamic Streaming Topologies

4

F

Page 5: A RESTful API for Controlling Dynamic Streaming Topologies

5

C

Page 6: A RESTful API for Controlling Dynamic Streaming Topologies

6

P C

Page 7: A RESTful API for Controlling Dynamic Streaming Topologies

7

Page 8: A RESTful API for Controlling Dynamic Streaming Topologies

8

Web Liquid Streams

Page 9: A RESTful API for Controlling Dynamic Streaming Topologies

8

Web Liquid Streams

Page 10: A RESTful API for Controlling Dynamic Streaming Topologies

8

Web Liquid Streams

Page 11: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 12: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 13: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 14: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 15: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 16: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 17: A RESTful API for Controlling Dynamic Streaming Topologies

9

Page 18: A RESTful API for Controlling Dynamic Streaming Topologies

10

Page 19: A RESTful API for Controlling Dynamic Streaming Topologies

x

11

F

CP

F

F

WebSocket

WebRTC

WebSocket

ZeroMQ

ZeroMQ

Page 20: A RESTful API for Controlling Dynamic Streaming Topologies

x

11

F

CP

F

F

WebSocket

WebRTC

WebSocket

ZeroMQ

ZeroMQ

Page 21: A RESTful API for Controlling Dynamic Streaming Topologies

x

11

F

CP

F

F

WebSocket

WebRTC

WebSocket

ZeroMQ

ZeroMQ

Page 22: A RESTful API for Controlling Dynamic Streaming Topologies

12

F

Workers

Page 23: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 24: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 25: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 26: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 27: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 28: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 29: A RESTful API for Controlling Dynamic Streaming Topologies

13

F

Operator Elasticity

Page 30: A RESTful API for Controlling Dynamic Streaming Topologies

14

F

Fault Tolerance

Page 31: A RESTful API for Controlling Dynamic Streaming Topologies

14

F

Fault Tolerance

Page 32: A RESTful API for Controlling Dynamic Streaming Topologies

14

F

Fault Tolerance

Page 33: A RESTful API for Controlling Dynamic Streaming Topologies

14

F

Fault Tolerance

Page 34: A RESTful API for Controlling Dynamic Streaming Topologies

15

F

CP

F

FX

Page 35: A RESTful API for Controlling Dynamic Streaming Topologies

15

F

CP

F

FX

Page 36: A RESTful API for Controlling Dynamic Streaming Topologies

15

F

CP

F

Page 37: A RESTful API for Controlling Dynamic Streaming Topologies

15

F

CP

F

F

Page 38: A RESTful API for Controlling Dynamic Streaming Topologies

16

Operator MigrationF

CP

F

Page 39: A RESTful API for Controlling Dynamic Streaming Topologies

16

Operator MigrationF C

P

F

Page 40: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F

Page 41: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F

Page 42: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F C

Page 43: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F C

Page 44: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F C

Page 45: A RESTful API for Controlling Dynamic Streaming Topologies

17

Peer OverloadingF

CP

F C

Page 46: A RESTful API for Controlling Dynamic Streaming Topologies

18

API

WLS Runtime

P C

Page 47: A RESTful API for Controlling Dynamic Streaming Topologies

19

RPC

Page 48: A RESTful API for Controlling Dynamic Streaming Topologies

20

REST

Page 49: A RESTful API for Controlling Dynamic Streaming Topologies

21

Operator

Tight Coupling

Page 50: A RESTful API for Controlling Dynamic Streaming Topologies

22

Operator

Page 51: A RESTful API for Controlling Dynamic Streaming Topologies

22

Operator

Page 52: A RESTful API for Controlling Dynamic Streaming Topologies

22

Operator

Page 53: A RESTful API for Controlling Dynamic Streaming Topologies

22

Operator

Page 54: A RESTful API for Controlling Dynamic Streaming Topologies

22

Operator

Page 55: A RESTful API for Controlling Dynamic Streaming Topologies

23

Independent Evolution

Operator

Page 56: A RESTful API for Controlling Dynamic Streaming Topologies

23

Independent Evolution

Operator

Page 57: A RESTful API for Controlling Dynamic Streaming Topologies

23

Independent Evolution

Operator

Page 58: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

Page 59: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

operators[0].getWorkers();

Page 60: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

Exception

Page 61: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

GET …/workers

Page 62: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

“request timeout”

Page 63: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

{!! “error” : …!}

Page 64: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

GET …/workers

Page 65: A RESTful API for Controlling Dynamic Streaming Topologies

24

Operator

Error Detection & Recovery

Page 66: A RESTful API for Controlling Dynamic Streaming Topologies

25

Representations

{ "topology": { "id": "example", "operators": […], "bindings": […] } }

<topology> <id>example</id> <operators> <operator>…</operator> … </operators> <bindings> <binding>…</binding> … </bindings> </topology>

Page 67: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Page 68: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Operators

Page 69: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Bindings

Page 70: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Workers

Page 71: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Peers

Page 72: A RESTful API for Controlling Dynamic Streaming Topologies

2626

F

CP

F

F

Topologies

Page 73: A RESTful API for Controlling Dynamic Streaming Topologies

27

Hypermedia Data Model

Page 74: A RESTful API for Controlling Dynamic Streaming Topologies

28

Peer Discovery

C

F GET /!GET /peers!POST /peers!GET /peers/:pid!DELETE /peers/:pid

Page 75: A RESTful API for Controlling Dynamic Streaming Topologies

29

Peer Representation

{! "peer": ! {!!!!!!"id": "example",! !!!!!"operators": […],! !!!!!"topologies": […],! !!!!!"CPU": [0, 50, 0] ! !!!}! }

GET /peers/example

Page 76: A RESTful API for Controlling Dynamic Streaming Topologies

30

Topologies

GET /topologies!POST /topologies!GET /topologies/:tid!PUT /topologies/:tid!DELETE /topologies/:tid

F

CP

F

Page 77: A RESTful API for Controlling Dynamic Streaming Topologies

31

Topology Representation

{ "topology": { "id": "example", "operators": […], "bindings": […] } }

GET /topologies/example

Page 78: A RESTful API for Controlling Dynamic Streaming Topologies

32

F

Operators

GET /operators!GET /topologies/:tid/operators!GET /topologies/:tid/operators/:oid!PUT /topologies/:tid/operators/:oid!PATCH /topologies/:tid/operators/:oid/script!PATCH /topologies/:tid/operators/:oid/bindings!DELETE /topologies/:tid/operators/:oid

Page 79: A RESTful API for Controlling Dynamic Streaming Topologies

33

{! "operators" : [! {! "topology" : "example",! "id" : "prod",! "workers" : […],! "href" : “…/topologies/example/operators/prod”,! "peer" : "http://IP:port/",! "replicas" : [! ! "http://IP2:port2/topologies/example/operators/prod"!! ! ] !

! },!

]!

}

Operator RepresentationGET /topologies/example/operators

Page 80: A RESTful API for Controlling Dynamic Streaming Topologies

34

“topology” : { “operators: […], "bindings": [ { "from": “…/topologies/example/operators/a”, "to": “…/topologies/example/operators/b”, "type": "round_robin" }, { "from": “…/topologies/example/operators/b”, "to": “…/topologies/example/operators/c”, "type": "broadcast" } ] }

Binding Representation

Page 81: A RESTful API for Controlling Dynamic Streaming Topologies

35

Workers

GET !/topologies/:tid/operators/:oid/workers!GET !/topologies/:tid/operators/:oid/workers/:wid!POST !/topologies/:tid/operators/:oid/workers!DELETE !/topologies/:tid/operators/:oid/workers/:wid

Page 82: A RESTful API for Controlling Dynamic Streaming Topologies

36

“operators“ : [!

!{!

! "topology" : "example",!

"id" : "prod", ! "workers" : [!! ! {!! ! ! "id" : "0",!! ! ! "href" : “…/topologies/example/operators/prod/workers/0”,!! ! ! "operator" : “…/topologies/example/operators/prod”,!! ! ! "uptime" : 3600,!! ! ! "messages" : 42,!! ! ! "req-res-ratio" : 1.5!! ! }, …!

! ],!

! …!

! }!

]

Worker Representation

Page 83: A RESTful API for Controlling Dynamic Streaming Topologies

37

Page 84: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

Load Balancing

Page 85: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

Load Balancing

Page 86: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

GET /topologies/:tid/operators/:oid/workers

Load Balancing

Page 87: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

“workers”: [ ! {!! ! ! "id" : "0",!! ! ! "href" : …,,!! ! ! "operator" : …,!! ! ! "uptime" : 3600,!! ! ! "messages" : 42,!! ! ! "req-res-ratio" : 1.5”,!! ! },! !…! ]Load Balancing

Page 88: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

POST /topologies/:tid/operators/:oid/workers

Load Balancing

Page 89: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

Load Balancing

Page 90: A RESTful API for Controlling Dynamic Streaming Topologies

3838

F

Load Balancing

Page 91: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

Fault Tolerance

Page 92: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

Fault Tolerance

Page 93: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

GET /topologies/:tid/operators/:oid/workers

Fault Tolerance

Page 94: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

“workers”: [ ! {!

! ! ! "id" : "0",!! ! ! "href" : “…/prod/workers/0”,!! ! ! …!! ! },!

{!

! ! ! “id” : “1”,!! ! ! “href” : …,!! ! ! “error”: “request timeout”!

! ! }!

]Fault Tolerance

Page 95: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

POST /topologies/:tid/operators/:oid/workers

Fault Tolerance

Page 96: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

Fault Tolerance

Page 97: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

DELETE /topologies/:tid/operators/:oid/workers/:wid

Fault Tolerance

Page 98: A RESTful API for Controlling Dynamic Streaming Topologies

3939

F

Fault Tolerance

Page 99: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

Fault Tolerance

Page 100: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

Fault Tolerance

Page 101: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

GET /topologies/:tid/operators

Fault Tolerance

Page 102: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

“operators”: [ ! {!! ! ! …!! ! },! {!! ! “id” : “C”,!! ! “href” : …,!! ! “error” : !! ! “request timeout”!! ! }! ]Fault Tolerance

Page 103: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

PUT /topologies/:tid/operators/C

Fault Tolerance

Page 104: A RESTful API for Controlling Dynamic Streaming Topologies

PATCH /topologies/:tid/operators/bindings

40

F

CP

F

C

Fault Tolerance

Page 105: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

CP

F

C

DELETE /topologies/:tid!/operators/C

Fault Tolerance

Page 106: A RESTful API for Controlling Dynamic Streaming Topologies

40

F

P

F

C

Fault Tolerance

Page 107: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

Fault Tolerance

Page 108: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

Fault Tolerance

Page 109: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

GET /peers/:pid

Fault Tolerance

Page 110: A RESTful API for Controlling Dynamic Streaming Topologies

connection timeout

41

F

CP

F

Fault Tolerance

Page 111: A RESTful API for Controlling Dynamic Streaming Topologies

PUT /topologies/:tid/operators/…

41

F

CP

F

Fault Tolerance

Page 112: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

CF

Fault Tolerance

Page 113: A RESTful API for Controlling Dynamic Streaming Topologies

PATCH /topologies/:tid/operators/bindings

41

F

CP

F

CF

Fault Tolerance

Page 114: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

CF

Fault Tolerance

Page 115: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

CP

F

CF

Fault Tolerance

Page 116: A RESTful API for Controlling Dynamic Streaming Topologies

DELETE /topologies/:tid!/operators/…

41

F

CP

F

CF

Fault Tolerance

Page 117: A RESTful API for Controlling Dynamic Streaming Topologies

41

F

P

CF

Fault Tolerance

Page 118: A RESTful API for Controlling Dynamic Streaming Topologies

42

F

CP

F

Peer Overloading

Page 119: A RESTful API for Controlling Dynamic Streaming Topologies

42

F

CP

F

GET /peers/:pid

Peer Overloading

Page 120: A RESTful API for Controlling Dynamic Streaming Topologies

42

F

CP

F

{ !

! “peer”: ! {!

! ! ! …!

! ! ! “CPU” : !

! ! ! [100,100,100]! !

! }!

}Peer Overloading

Page 121: A RESTful API for Controlling Dynamic Streaming Topologies

PUT /topologies/:tid/operators/C

42

F

CP

F

Peer Overloading

Page 122: A RESTful API for Controlling Dynamic Streaming Topologies

PATCH /topologies/:tid/operators/bindings

42

F

CP

F

C

Peer Overloading

Page 123: A RESTful API for Controlling Dynamic Streaming Topologies

42

F

CP

F

C

Peer Overloading

Page 124: A RESTful API for Controlling Dynamic Streaming Topologies

42

F

CP

F

C

Peer Overloading

Page 125: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

Leaving Peer

Page 126: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

DELETE /peers/IP:port

Leaving Peer

Page 127: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

Leaving Peer

Page 128: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

PUT /topologies/:tid/operators/…

Leaving Peer

Page 129: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

CF

PATCH /topologies/:tid/operators/bindings

Leaving Peer

Page 130: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

CP

F

CF

DELETE /topologies/:tid!/operators/…

Leaving Peer

Page 131: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

P

CF

Leaving Peer

Page 132: A RESTful API for Controlling Dynamic Streaming Topologies

43

F

P

CF

Leaving Peer

Page 133: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 134: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 135: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 136: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 137: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 138: A RESTful API for Controlling Dynamic Streaming Topologies

44

Page 139: A RESTful API for Controlling Dynamic Streaming Topologies

A RESTful API for Controlling Dynamic Streaming TopologiesMasiar Babazadeh!University of Lugano Switzerland @masiarb

Cesare Pautasso!University of Lugano Switzerland @pautasso

45

http://design.inf.usi.ch/