Broker Bros New Communication Library Robin Sommer ICSI / LBNL / - - PowerPoint PPT Presentation

broker bro s new communication library
SMART_READER_LITE
LIVE PREVIEW

Broker Bros New Communication Library Robin Sommer ICSI / LBNL / - - PowerPoint PPT Presentation

Broker Bros New Communication Library Robin Sommer ICSI / LBNL / Broala robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin Bro Communication 2 Broker Bro Communication Exchanging Events Separates event generation from


slide-1
SLIDE 1

Robin Sommer

ICSI / LBNL / Broala

robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin

Broker Bro’s New Communication Library

slide-2
SLIDE 2

Broker

Bro Communication

2

slide-3
SLIDE 3

Broker

Bro Communication

Exchanging Events

Separates event generation from handling.

2

slide-4
SLIDE 4

Broker

Bro Communication

Exchanging Events

Separates event generation from handling.

Logging Remotely

Aggregates logs on remote side.

2

slide-5
SLIDE 5

Broker

Bro Communication

Exchanging Events

Separates event generation from handling.

Logging Remotely

Aggregates logs on remote side.

Distributing State

Provides shared view across instances.

2

slide-6
SLIDE 6

Broker

Bro Communication

Exchanging Events

Separates event generation from handling.

Logging Remotely

Aggregates logs on remote side.

Distributing State

Provides shared view across instances.

2

slide-7
SLIDE 7

Broker

Use Case: Bro Cluster

3

Bro Manager Bro Worker 1 Bro Worker 2

Load-balanced Traffic Stream

Bro Worker 3

Logs & Events

slide-8
SLIDE 8

Broker

Use Case: Bro Cluster

3

Bro Manager Bro Worker 1 Bro Worker 2

Load-balanced Traffic Stream

Bro Proxy Bro Worker 3

&synchronized State Logs & Events

slide-9
SLIDE 9

Broker

Use Case: External Integration

4

Application A Application B Events

Bro

Application C

slide-10
SLIDE 10

Broker

Traditional Implementation

5

Bro A Bro B

Events Logs State Updates

slide-11
SLIDE 11

Broker

Traditional Implementation

5

Bro A Child Process Child Process Bro B

Events Logs State Updates

slide-12
SLIDE 12

Broker

Traditional Implementation

5

Bro A Child Process Child Process Bro B libbroccoli

Events Logs State Updates Events C Python Ruby Perl

slide-13
SLIDE 13

Broker

Traditional Implementation

5

Bro A Child Process Child Process Bro B libbroccoli

Events Logs State Updates Events C Python Ruby Perl

It’s showing its age …

Race conditions with &synchronized. No good persistence story. Not much control over data flow. Complex & inefficient protocol. Implementation deficiencies. Two independent implementations.

slide-14
SLIDE 14

Broker

Introducing the Broker Library

6

Bro A Bro B

Events Logs State Updates

slide-15
SLIDE 15

Broker

Introducing the Broker Library

6

Bro A Bro B Broker Broker

Events Logs State Updates

slide-16
SLIDE 16

Broker

Introducing the Broker Library

6

Bro A Bro B Broker Broker Broker

C C++ Python

Application

Events Logs State Updates

slide-17
SLIDE 17

Broker

Introducing the Broker Library

6

Bro A Bro B Broker Broker Broker

C C++ Python

Application

Events Logs State Updates

Broker

Unified Library New protocol Publish/subscribe Limiting type system’s flexibility. Explicit state operations.

slide-18
SLIDE 18

Broker

Exchanging Events with Broker

7

Bro Broker Broker Bro Receiver Sender my_event(“Bro”, 42)

slide-19
SLIDE 19

Broker

Exchanging Events with Broker

7

Bro Broker Broker Bro Receiver Sender my_event(“Bro”, 42) Topic: “bro/event”

slide-20
SLIDE 20

Broker

Exchanging Events with Broker

7

Bro Broker Broker Bro Receiver Sender subscribe_to_events(“bro/event”) my_event(“Bro”, 42) Topic: “bro/event”

slide-21
SLIDE 21

Broker

Exchanging Events with Broker

7

Bro Broker Broker Bro Receiver Sender subscribe_to_events(“bro/event”) my_event(“Bro”, 42) my_event(“Bro”, 42) Topic: “bro/event”

slide-22
SLIDE 22

Broker

Exchanging Events with Broker

7

Bro Broker Broker Bro Receiver Sender subscribe_to_events(“bro/event”) my_event(“Bro”, 42) my_event(“Bro”, 42) my_event(“Bro”, 42) Topic: “bro/event”

slide-23
SLIDE 23

Broker

Exchanging Events with Broker

8

Demo

slide-24
SLIDE 24

Broker

Forwarding Logs with Broker

9

Broker Bro Broker Bro Receiver Sender Log::write(…)

slide-25
SLIDE 25

Broker

Forwarding Logs with Broker

9

Broker Bro Broker Bro Receiver Sender Log::write(…) Topic: “bro/log”

slide-26
SLIDE 26

Broker

Forwarding Logs with Broker

9

Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Topic: “bro/log”

slide-27
SLIDE 27

Broker

Forwarding Logs with Broker

9

Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Log::write(…) Topic: “bro/log”

slide-28
SLIDE 28

Broker

Forwarding Logs with Broker

9

Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Log::write(…) Log::write(…) Topic: “bro/log”

slide-29
SLIDE 29

Broker

Data Stores with Broker

10

slide-30
SLIDE 30

Broker

Data Stores with Broker

10

Broker maintains global, persistent key/value stores.

slide-31
SLIDE 31

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

slide-32
SLIDE 32

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

slide-33
SLIDE 33

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

slide-34
SLIDE 34

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

slide-35
SLIDE 35

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

slide-36
SLIDE 36

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

clone()

Key Value

Cached Version

slide-37
SLIDE 37

Broker

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

clone()

Key Value

Cached Version

{ content }

192.150.187.12 21 131.159.14.1 5

slide-38
SLIDE 38

Broker

Bro Broker

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

slide-39
SLIDE 39

Broker

Bro Broker

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”) n = lookup(c, 192.150.187.12)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

slide-40
SLIDE 40

Broker

Bro Broker

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”) insert(c, 192.150.187.43, 1947) n = lookup(c, 192.150.187.12)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

slide-41
SLIDE 41

Broker

Bro Broker

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”) insert(c, 192.150.187.43, 1947) n = lookup(c, 192.150.187.12)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

insert(…)

192.150.187.43 1947

slide-42
SLIDE 42

Broker

Bro Broker

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

Data Stores with Broker

10

Bro Broker Bro Broker Client Master

Broker maintains global, persistent key/value stores.

s = create_master(“my_store”) insert(c, 192.150.187.43, 1947) n = lookup(c, 192.150.187.12)

Key Value

Authoritative Version

insert(s, 192.150.187.12, 21)

192.150.187.12 21

insert(s, 131.159.14.1, 5)

131.159.14.1 5

c = create_clone(“my_store”)

Key Value

Cached Version 192.150.187.12 21 131.159.14.1 5

insert(…)

192.150.187.43 1947

insert(…) insert(…)

192.150.187.43 1947 192.150.187.43 1947

slide-43
SLIDE 43

Broker

Data Stores with Broker

11

Demo

slide-44
SLIDE 44

Broker

Data Store Features

12

slide-45
SLIDE 45

Broker

Data Store Features

Data Types Supports Bro data types for keys & values.

12

slide-46
SLIDE 46

Broker

Data Store Features

Data Types Supports Bro data types for keys & values. Operations Increment/decrement. Set insert/delete. Vector push/pop. Automatic expiry.

12

slide-47
SLIDE 47

Broker

Data Store Features

Data Types Supports Bro data types for keys & values. Operations Increment/decrement. Set insert/delete. Vector push/pop. Automatic expiry. Persistence Choice of SQLite or RocksDB.

12

slide-48
SLIDE 48

Broker

Broker Bits & Pieces

13

slide-49
SLIDE 49

Broker

Broker Bits & Pieces

Fine-granular Subscription Model

All elements come with a topic or name. Prefixed-based subscription for topics. Fine control what’s published and subscribed to.

13

slide-50
SLIDE 50

Broker

Broker Bits & Pieces

Fine-granular Subscription Model

All elements come with a topic or name. Prefixed-based subscription for topics. Fine control what’s published and subscribed to.

Security Model

Peers are assumed to be trustworthy. Currently no encryption/authentication; SSL later.

13

slide-51
SLIDE 51

Broker

Broker’s Foundation: CAF

14

http://actor-framework.org

slide-52
SLIDE 52

Broker

Broker’s Foundation: CAF

C++ Actor Framework

Concurrency through Erlang-style lightweight actors. Concise messaging API. Network-transparency abstracting transport. Efficient and adaptive. BSD license.

14

http://actor-framework.org

slide-53
SLIDE 53

Broker

Broker’s Foundation: CAF

C++ Actor Framework

Concurrency through Erlang-style lightweight actors. Concise messaging API. Network-transparency abstracting transport. Efficient and adaptive. BSD license.

Trade-Offs

Needs a C++11 compiler. Introduces a new, non-standard dependency.

14

http://actor-framework.org

slide-54
SLIDE 54

Broker

The Future: A “Stateful Deep Cluster”

15

slide-55
SLIDE 55

Broker

The Future: A “Stateful Deep Cluster”

15

Example: Geographically distributed organization.

Global Master Bro

slide-56
SLIDE 56

Broker

The Future: A “Stateful Deep Cluster”

15

Example: Geographically distributed organization.

Bro

US

Bro

UK

Bro

FR

Bro

CN

Regional Heads Global Master Bro

slide-57
SLIDE 57

Broker

The Future: A “Stateful Deep Cluster”

15

Bro Bro Bro Bro Bro Bro Bro Bro

Local Clusters

Example: Geographically distributed organization.

Bro

US

Bro

UK

Bro

FR

Bro

CN

Regional Heads Global Master Bro

slide-58
SLIDE 58

Broker

The Future: A “Stateful Deep Cluster”

15

Bro Bro Bro Bro Bro Bro Bro Bro

Local Clusters

Example: Geographically distributed organization.

Bro

US

Bro

UK

Bro

FR

Bro

CN

Regional Heads Global Master Bro

Corp/US/ Corp/UK/ Corp/FR/ Corp/CN/ Corp/GLOBAL/

Corp/US/… Corp/US/… Corp/UK/… Corp/UK/… Corp/FR/… Corp/FR/… Corp/CN/… Corp/CN/…

slide-59
SLIDE 59

Broker

The Future: A “Stateful Deep Cluster”

15

Bro Bro Bro Bro Bro Bro Bro Bro

Local Clusters

Data Node Data Node Data Node Data Node

Data Node

Example: Geographically distributed organization.

Bro

US

Bro

UK

Bro

FR

Bro

CN

Regional Heads Global Master Bro

Corp/US/ Corp/UK/ Corp/FR/ Corp/CN/ Corp/GLOBAL/

Corp/US/… Corp/US/… Corp/UK/… Corp/UK/… Corp/FR/… Corp/FR/… Corp/CN/… Corp/CN/…

slide-60
SLIDE 60

Broker

Broker, beyond Bro

16

slide-61
SLIDE 61

Broker

Broker, beyond Bro

16

Distributed, real-time publish/subscribe platform, with a data model.

slide-62
SLIDE 62

Broker

What This All Means for You Right Now

17

slide-63
SLIDE 63

Broker

What This All Means for You Right Now

Bro 2.4

Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)

17

slide-64
SLIDE 64

Broker

What This All Means for You Right Now

Bro 2.4

Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)

Git master, as of today

Legacy communication still the primary mechanism. Broker built by default, —disable-broker turns off.

(CAF 0.14, C++11)

17

slide-65
SLIDE 65

Broker

What This All Means for You Right Now

Bro 2.4

Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)

Git master, as of today

Legacy communication still the primary mechanism. Broker built by default, —disable-broker turns off.

(CAF 0.14, C++11)

Bro 2.5 (tentative)

Broker provides primary communication mechanism. Legacy communication deprecated, but remains available.

17

slide-66
SLIDE 66

Broker

What This All Means for You Right Now

Bro 2.4

Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)

Git master, as of today

Legacy communication still the primary mechanism. Broker built by default, —disable-broker turns off.

(CAF 0.14, C++11)

Bro 2.5 (tentative)

Broker provides primary communication mechanism. Legacy communication deprecated, but remains available.

Bro 2.6 (even more tentative)

Broker provides primary communication mechanism. Legacy communication no longer available.

17

slide-67
SLIDE 67

Broker

What This All Means for You Right Now

Bro 2.4

Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)

Git master, as of today

Legacy communication still the primary mechanism. Broker built by default, —disable-broker turns off.

(CAF 0.14, C++11)

Bro 2.5 (tentative)

Broker provides primary communication mechanism. Legacy communication deprecated, but remains available.

Bro 2.6 (even more tentative)

Broker provides primary communication mechanism. Legacy communication no longer available.

17

Credit for Broker goes to Jon Siwek!

slide-68
SLIDE 68

Robin Sommer

ICSI / LBNL / Broala

robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin

Questions?