publish/subscribejacobsen/courses/ece1770/...publish/subscribe lecture 11 middleware systems...

46
1 Publish/Subscribe Hans-Arno Jacobsen Bell University Laboratory Chair in Software Engineering Middleware Systems Research Group University of Toronto MIDDLEWARE SYSTEMS RESEARCH GROUP

Upload: others

Post on 22-Aug-2020

8 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

1

Publish/Subscribe

Hans-Arno Jacobsen

Bell University Laboratory Chair in Software EngineeringMiddleware Systems Research GroupUniversity of Toronto

MIDDLEWARE SYSTEMSRESEARCH GROUP

Page 2: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 2

MIDDLEWARE SYSTEMSRESEARCH GROUP

Amazon to Chapters to you ....

Monday, October 10th in Cyberspace

Your book “...”is available

at .... $10 off

Thursday, November 15th,in Toronto

Page 3: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 3

MIDDLEWARE SYSTEMSRESEARCH GROUP

Business Process Execution & Web Service Composition

Broker

BrokerBroker

Broker

WSAgent

Agent Broker

……

Database

WSClient

Pick Invoke

Wait

Scope

Receive

Assign

Flow

Reply

Business Process

Scope

Reply

Business Process

Scope

Receive

SwitchClient

Page 4: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 4

MIDDLEWARE SYSTEMSRESEARCH GROUP

Other “Similar” ApplicationsSelective information disseminationLocation-based servicesPersonalizationAlerting servicesApplication integrationJob schedulingMonitoring, surveillance, and control Network and distributed system managementWorkforce management(Scientific) workload managementBusiness activity monitoringBusiness process management, monitoring, and execution

Page 5: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 5

MIDDLEWARE SYSTEMSRESEARCH GROUP

What Relates All These Applications?

Asynchronous state transitions captured as events that

drive and underlayall applications andinfrastructures implementing these applications

Require middleware support for event processingPublish/Subscribe is ideally suited to fulfill these requirements

Page 6: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 6

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe

Page 7: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 7

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe

Publisher Publisher

Subscriber Subscriber

Subscriptions

Publications

NotificationNotification

IBM=84

MSFT=27 INTC=19 JNJ=58ORCL=12

HON=24

AMGN=58

Stock marketsNYSE

NASDAQTSX

Subscriptions:IBM > 85ORCL < 10JNJ > 60

Broker(s)

Page 8: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 8

MIDDLEWARE SYSTEMSRESEARCH GROUP

Data(a lot of)

Subscriptions(a lot of)

query publication

Query and subscription is very similar.Set of tuples and publication is very similar.

However, the two problem statements are inverse.

That’s Like Data Base Querying !!

Sets of tuples Matching subscriptions

Abo

ut p

ast

Abo

ut fu

ture

Page 9: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 9

MIDDLEWARE SYSTEMSRESEARCH GROUP

Key Benefit of Publish/Subscribe

Decoupling of publishers and subscribersPublishers do not need to know subscribersPublishers and subscribers do not need to be up simultaneouslyAmenable for physical distribution

Page 10: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 10

MIDDLEWARE SYSTEMSRESEARCH GROUP

Benefits of Publish/Subscribe

independence of participantslends itself well to distributed system development

de-coupled development & processing(dynamic) system evolution

interaction with large number of entities facilitatednaturally supports non-continuous operationspotential for scalability & fault-toleranceopen for (legacy) system integration on either end

Of course it is not a one size fits all paradigm, but a good solution for certain kinds of problems.

Page 11: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 11

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe Matching Problem

Given a set of subscriptions, S, and a publication, e, return all s in S matched by e. e is referred to as event or publicationSplitting hairs

Event is a state transition of interest in the environmentPublication is the information about e submitted to the publish/subscribe system

Simple problem statement, widely applicable, and lots of open questions

Page 12: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 12

MIDDLEWARE SYSTEMSRESEARCH GROUPProblem Instantiations I

Text / search strings (information filtering)Semi-structured data / queries

attribute-value pairs / attribute-operator-value-predicatesXML, HTML

Tree-structured data / path expressionsXML ./ XPath expressions

Graph-structured data / graph queriesRDF / RDF queries (e.g., SPARQL)

Regular languages / regular expressionsTables / SQL queries

Page 13: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 13

MIDDLEWARE SYSTEMSRESEARCH GROUP

Problem Instantiations II

Different matching semanticsCrispApproximate, Similarn-of-m (n of m predicates match)Probability of match

Page 14: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 14

MIDDLEWARE SYSTEMSRESEARCH GROUP

Problem Instantiations III

Centralized and distributed instantiationNetworking architecture

Internet (as overlay network)Peer-to-peer style interface (DHT, table-lookup)With mobile publishers, subscribers, brokersAd hoc network

Page 15: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 15

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe Models

Channel-based modelSubscribe & publish to a channel

Topic-based model… topics and topic hierarchy

Type-based model… typed objects

Content-based model… to content of messages

Subject-spaces (State-based model)Maintain state in publications and subscriptions

Page 16: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 16

MIDDLEWARE SYSTEMSRESEARCH GROUP

Channel-based

Publisher

Broadcast Channel

Publisher

Subscriber Subscriber Subscriber

Page 17: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 17

MIDDLEWARE SYSTEMSRESEARCH GROUP

Topic-based publish/subscribe

publication

news

Canada

politics sports

soccer

US

politics sports

soccer

Page 18: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 18

MIDDLEWARE SYSTEMSRESEARCH GROUP

The Content-based Model

Language and Data modelConjunctive Boolean functions over predicatesPredicates are attribute-operator-value triples

[class,=,trigger]

Subscriptions are conjunctions of predicates[class,=,trigger],[appl,=,payroll],[gid,=,g001]

Publications are sets of attribute-value pairs[class,trigger],[appl,printer],[gid,g007]

Matching semanticA subscription matches if all its predicates are matched

Page 19: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 19

MIDDLEWARE SYSTEMSRESEARCH GROUP

Content-based routing

Distributed publish/subscribeNetwork of publish/subscribe brokersSubscriptions & publications are injected into network at closest edge brokerRouting protocol distributes subscriptions throughout networkNetwork routes relevant publications to interested subscribersRouting is based on content; it is not based on addresses, which are not availableSubscriptions may change dynamically

Page 20: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

MIDDLEWARE SYSTEMSRESEARCH GROUP

Content-based Routing

Publisher

Subscriber

1. Advertise

2. Subscribe

3. Publish

Event-Based

Decoupled

Flexible

Responsive

Content Routing

Declarative

A: [class, =, stock], [name, =, HP], [price, >, 50]S: [class, =, stock], [name, =, *], [price, >, 50]P: [class, stock], [name, *], [price, 50]

Page 21: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 21

MIDDLEWARE SYSTEMSRESEARCH GROUP

Applications

A

B C

D

E

F

RFID and sensor networksService oriented architecture

Workflows, business processes and job scheduling

Supply chain and logistics

Event-Based

Light

CallbackRazor SKU

Transform

Fault

Temperature

Invoke Loan

Order

Delivered

In flightJob A done

Trigger

Page 22: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 22

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe in Industry

StandardsCORBA Event ServiceCORBA Notification ServiceOMG Data Dissemination ServiceJava Messaging ServiceWS EventingWS NotificationINFO-D (Grid Forum)

Emerging technologiesRSS aggregators

PubSub.com, FeedTreeReal-time data dissemination

TIBCO, RTI Inc., Mantara Software

Application integrationSoftwired

Hardware-based brokersSarvega (Intel), Solace Systems, DataPower(IBM)

Page 23: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 23

MIDDLEWARE SYSTEMSRESEARCH GROUP

Publish/Subscribe in Academia

Research projectsElvin (Australia)Gryphon (IBM)Hermes (Cambridge)SIENA (Boulder)REBECA (Darmstadt)ToPSS (UofT)PADRES (UofT)

Page 24: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 24

MIDDLEWARE SYSTEMSRESEARCH GROUP

The Toronto Publish/Subscribe System Family (ToPSS)

Matching algorithmsLanguage expressiveness, scalability, speed

Routing protocolsNetwork architectures, scalability

Higher level abstractionsWorkflow executionMonitoring

S-ToPSS(semantic)

X-ToPSS(XML matching)

A-ToPSS(approximate)

persistent-ToPSS(subject spaces)

L-ToPSS(location-based)

ToPSS(matching)

M-ToPSS(mobile)

Ad hoc-ToPSS(ad hoc networking)

Federated-ToPSS(federation of ToPSS brokers)

Rb-ToPSS(rule-based)

P2P-ToPSS(peer-to-peer)

LB-ToPSS(load balancing)

FT-ToPSS(fault tolerance)

Historic-ToPSS(historic data)

CS-ToPSS(composite subs)

BPEL-ToPSS(BPEL execution)

JS-ToPSS(job scheduling)

Page 25: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 25

MIDDLEWARE SYSTEMSRESEARCH GROUP

Overall Project VisionA

Rea

l-Tim

e Ev

ent-d

riven

Ent

erpr

ise

Page 26: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 26

MIDDLEWARE SYSTEMSRESEARCH GROUP

Matching and Content-based Routing

input queue

output queues

Sn A

AAn

Sn

An

SP

Routing Tables

SP

Page 27: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 27

MIDDLEWARE SYSTEMSRESEARCH GROUP

Matching Algorithms

For solving the pub/sub matching problem

Tree-based algorithmsGraph-based algorithmsAutomaton-based algorithms (NFA, DFA)Two-staged algorithms

predicate matchingsubscription matching

Page 28: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 28

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Matching

Page 29: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 29

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate matching problem

Given a set P of predicates and an event e, identify all predicates p of P which evaluate to true under e.Example:

e = {…, (price, 5), (color, white) …}

p1: price > 5; p2: color = red; p3: price < 4

p1 is false p2 is false p3 is truepredicate bit vector:0 0 1 ...

p1 p2 p3predicate IDs

Page 30: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 30

MIDDLEWARE SYSTEMSRESEARCH GROUP

Data structure overview

price...

...

predicate index

hash table on attribute name

e = {…, (price, 5), …}

color

Page 31: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 31

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Index

price=<>!=

1 p17 5 p4

0 p11

2 p6

1 p7

5 p1

5 p9

4 p3

7 p13

one ordered linked list per operatorinsert, delete, match are O(n)-operations (per attribute name in e and per operator)alternatively, use a B-tree or B+-tree etc.

}=

Page 32: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 32

MIDDLEWARE SYSTEMSRESEARCH GROUP

Observations

countable domain types with small cardinalityinteger intervalscollections (enums)a set of tags

Examplesprice : [0, 1000], models variety of pricescolor, city, state, country, size, weightall tags defined in a given DTDpredicate domain is often context dependant, but limited in size

prices of cars vs. prices of groceries

Page 33: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 33

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Matching for Finite Domains

price :[ 0, 1000]

=<

>!=

0 1000

e = {…, (price, 5), …}

p4

p1

p3

p1: price > 5; p3: price < 4; p4: price = 5; p9: price != 5...

1 2 3 ... 6 ...

...

...

...

...p7 p9

p13

p17

p11

p6

Page 34: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 34

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Matching Symmetries

price :[ 0, 1000]

T>

<!=

0 1000

e = {…, (price, 5), …}

p4

p1

p3

1 2 3 ... 6 ...

...

...

...

...p7 p9

p13

p17

p11

p6

=

FF F F F F F

FFFFFF F F

FTT

TT T T

T T

… F …

T T

T

T

Page 35: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 35

MIDDLEWARE SYSTEMSRESEARCH GROUP

Experiments and evaluation

Page 36: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 36

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Matching Performance (list-based scheme)

domain sizes: 250, 10,000, 100,000

4.5 M500 K

Page 37: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 37

MIDDLEWARE SYSTEMSRESEARCH GROUPPredicate Matching Performance

(table-based scheme)

4.5M500K

domain sizes: 250, 10,000, 100,000

Page 38: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 38

MIDDLEWARE SYSTEMSRESEARCH GROUP

Predicate Matching Performance

(tables-based vs. list-based scheme)

for the mixed domain

4.5 M

Page 39: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 39

MIDDLEWARE SYSTEMSRESEARCH GROUPPredicate Matching Data Structure Size

(table-based vs. list-based scheme)

20 MB

1.4 GB

4 M

Page 40: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 40

MIDDLEWARE SYSTEMSRESEARCH GROUP

Subscription Matching

Page 41: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 41

MIDDLEWARE SYSTEMSRESEARCH GROUP

Multiple one-dimension indexes

One-dimension indexes.hash tablesB-treesInterval Skip Lists

Counting algorithmHanson algorithmPropagation algorithm

Page 42: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 42

MIDDLEWARE SYSTEMSRESEARCH GROUP

Counting algorithm

Subscriptions consist of a set of predicatesS1: (2< A<4) & (B=6) & (C >4) ⇒ pA : (2< A<4), pB (B=6), pC:(C>4) S1: (2< A<4) & (C=3)⇒ pA : (2< A<4) pC: (C=3)

A Subscription matches the event if all its predicates are satisfied.Idea: Count the number of satisfied predicates per subscription

Page 43: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 43

MIDDLEWARE SYSTEMSRESEARCH GROUP

Data structuresfor the counting algorithm

p1

p2

p3

p4

S1S2

S1S2S1

TOTALNUMBER COUNT

S1 S1S2 S2

32

00

IndexesA B C

S1: p1,p2,p4

S3 0

Predicatevector

S2: p1,p3S3: p3,p5

S3

S3 2

p1 p2 p3 p4p3 p5

p3

p5 S3

Page 44: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 44

MIDDLEWARE SYSTEMSRESEARCH GROUP

Counting algorithm

p1

p2

p5

p3

p4

S1S2

S1S2S1

TOTALNUMBER COUNT

S1 S1S2 S2

32

00

IndexesA B C

S3 0

Predicatevector

E: (A,5),(B,6)

S3

S3 2

p1 p2 p3 p4 p5p3p2

p3

p2

S3

p1

p1

S1

S1

S2

S2

S31

1122

2

Page 45: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 45

MIDDLEWARE SYSTEMSRESEARCH GROUP

Subscription Matching

hit vector

preds-per-sub

pred

. bit

vec s17 s4

s11

s6

s7

s1

s9

s3

s13pr

ed. b

it v

ec

•bit-matrix based •list based

hit vector

preds-per-sub

subscription IDs

10110

...

+ sub-pred associationto support deletion

Page 46: Publish/Subscribejacobsen/courses/ece1770/...Publish/Subscribe Lecture 11 MIDDLEWARE SYSTEMS RESEARCH GROUP Publish/Subscribe Matching Problem Given a set of subscriptions, S, and

Publish/Subscribe Lecture 46

MIDDLEWARE SYSTEMSRESEARCH GROUP

Clustering Algorithm

p5

IndexesS1: p1,p2,p4S2: p1,p3,p5S3: p1,p4

AccessPredicatevector

0 0 0Bit Vector

p1 p2 p3 p4 p5 p6

p1

s1p2p4

s2p3p5

detail of cluster

list of clusters

2 1s3

A B C

p1 p2 p3 p4 p5p3p2p1

E: (A,5),(B,6),(C,3)satisfies p1,p2,p3,p4 s1,s2p1

0 0 01 1 1 1 s1p2p4

p3s2

p5

s1,s2

p4