Robin Sommer
ICSI / LBNL / Broala
robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin
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
ICSI / LBNL / Broala
robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin
Broker
2
Broker
Separates event generation from handling.
2
Broker
Separates event generation from handling.
Aggregates logs on remote side.
2
Broker
Separates event generation from handling.
Aggregates logs on remote side.
Provides shared view across instances.
2
Broker
Separates event generation from handling.
Aggregates logs on remote side.
Provides shared view across instances.
2
Broker
3
Bro Manager Bro Worker 1 Bro Worker 2
Load-balanced Traffic Stream
Bro Worker 3
Logs & Events
Broker
3
Bro Manager Bro Worker 1 Bro Worker 2
Load-balanced Traffic Stream
Bro Proxy Bro Worker 3
&synchronized State Logs & Events
Broker
4
Application A Application B Events
Bro
Application C
Broker
5
Bro A Bro B
Events Logs State Updates
Broker
5
Bro A Child Process Child Process Bro B
Events Logs State Updates
Broker
5
Bro A Child Process Child Process Bro B libbroccoli
Events Logs State Updates Events C Python Ruby Perl
Broker
5
Bro A Child Process Child Process Bro B libbroccoli
Events Logs State Updates Events C Python Ruby Perl
Race conditions with &synchronized. No good persistence story. Not much control over data flow. Complex & inefficient protocol. Implementation deficiencies. Two independent implementations.
Broker
6
Bro A Bro B
Events Logs State Updates
Broker
6
Bro A Bro B Broker Broker
Events Logs State Updates
Broker
6
Bro A Bro B Broker Broker Broker
C C++ Python
Application
Events Logs State Updates
Broker
6
Bro A Bro B Broker Broker Broker
C C++ Python
Application
Events Logs State Updates
Unified Library New protocol Publish/subscribe Limiting type system’s flexibility. Explicit state operations.
Broker
7
Bro Broker Broker Bro Receiver Sender my_event(“Bro”, 42)
Broker
7
Bro Broker Broker Bro Receiver Sender my_event(“Bro”, 42) Topic: “bro/event”
Broker
7
Bro Broker Broker Bro Receiver Sender subscribe_to_events(“bro/event”) my_event(“Bro”, 42) Topic: “bro/event”
Broker
7
Bro Broker Broker Bro Receiver Sender subscribe_to_events(“bro/event”) my_event(“Bro”, 42) my_event(“Bro”, 42) Topic: “bro/event”
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”
Broker
8
Broker
9
Broker Bro Broker Bro Receiver Sender Log::write(…)
Broker
9
Broker Bro Broker Bro Receiver Sender Log::write(…) Topic: “bro/log”
Broker
9
Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Topic: “bro/log”
Broker
9
Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Log::write(…) Topic: “bro/log”
Broker
9
Broker Bro Broker Bro Receiver Sender subscribe_to_logs(“bro/log”) Log::write(…) Log::write(…) Log::write(…) Topic: “bro/log”
Broker
10
Broker
10
Broker maintains global, persistent key/value stores.
Broker
10
Bro Broker Bro Broker Client Master
Broker maintains global, persistent key/value stores.
Broker
10
Bro Broker Bro Broker Client Master
Broker maintains global, persistent key/value stores.
s = create_master(“my_store”)
Key Value
Authoritative Version
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
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
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”)
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
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
Broker
Bro Broker
Key Value
Cached Version 192.150.187.12 21 131.159.14.1 5
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
Broker
Bro Broker
Key Value
Cached Version 192.150.187.12 21 131.159.14.1 5
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
Broker
Bro Broker
Key Value
Cached Version 192.150.187.12 21 131.159.14.1 5
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
Broker
Bro Broker
Key Value
Cached Version 192.150.187.12 21 131.159.14.1 5
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
Broker
Bro Broker
Key Value
Cached Version 192.150.187.12 21 131.159.14.1 5
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
Broker
11
Broker
12
Broker
12
Broker
12
Broker
12
Broker
13
Broker
All elements come with a topic or name. Prefixed-based subscription for topics. Fine control what’s published and subscribed to.
13
Broker
All elements come with a topic or name. Prefixed-based subscription for topics. Fine control what’s published and subscribed to.
Peers are assumed to be trustworthy. Currently no encryption/authentication; SSL later.
13
Broker
14
http://actor-framework.org
Broker
Concurrency through Erlang-style lightweight actors. Concise messaging API. Network-transparency abstracting transport. Efficient and adaptive. BSD license.
14
http://actor-framework.org
Broker
Concurrency through Erlang-style lightweight actors. Concise messaging API. Network-transparency abstracting transport. Efficient and adaptive. BSD license.
Needs a C++11 compiler. Introduces a new, non-standard dependency.
14
http://actor-framework.org
Broker
15
Broker
15
Example: Geographically distributed organization.
Global Master Bro
Broker
15
Example: Geographically distributed organization.
Bro
US
Bro
UK
Bro
FR
Bro
CN
Regional Heads Global Master Bro
Broker
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
Broker
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/…
Broker
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/…
Broker
16
Broker
16
Broker
17
Broker
Bro 2.4
Legacy communication still the primary mechanism. Broker optional, —enable-broker to compile support. (CAF 0.13, C++11)
17
Broker
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
Broker
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
Broker
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
Broker
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!
ICSI / LBNL / Broala
robin@icsi.berkeley.edu robin@broala.com http://www.icir.org/robin