




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Università di Roma “La Sapienza”Dipartimento di Informatica e Sistemistica
Middleware Laboratory
MID
LAB
University of Rome
Sapienza
University of Rome
Joint work with Leonardo Querzoni, Saso Tarkoma, AntoninoVirgillitoGoteborg - 25/3/
The publish/subscribe communication paradigm:
Publishers
: produce data in the form of
events
.
Subscribers
: declare interests on published data with subscriptions.
Each
subscription
is a filter on the set of published events.
An
Event Notification Service
(ENS) notifies to each subscriber every
published event that matches at least one of its subscriptions.
published event that matches at least one of its subscriptions.
Basic building blocks
publish
notify unsubscribe
subscribe
Middleware LaboratoryMiddleware LaboratoryLABMIDBasic building blocks
■
Events represent information structured following an
event
schema
.
■
The event schema is fixed, defined a-priori, and known toall the participants. ■
It defines a set of fields or attributes, each constituted by a
■
It defines a set of fields or attributes, each constituted by a^ name and a type. The types allowed depend on thespecific implementation, but basic types (like integers,floats, booleans, strings) are usually available. ■
Given an event schema, an event is a collection of values,one for each attribute defined in the schema.
Event schema and subscription models
Middleware LaboratoryMiddleware LaboratoryLABMIDEvent schema and subscription models
■
Example
:^
suppose
we
are
dealing
with
an
application
whose purpose is to distribute updates about computer-related blogs.
name
type
allowed values
blog_name
string
ANY
address
URL
ANY
Event
Event schema and subscription models
address
URL
ANY
genre
enumeration
[hardware, software, peripherals,development]
author
string
ANY
abstract
string
ANY
rating
integer
[1-5]
update_date
date
1-1-1970 00:
Event Schema
name
value
Middleware LaboratoryEvent schema and subscription models
name
value
blog_name
Prad.de
address
http://www.prad.de/en/index.html
genre
peripherals
author
Mark Hansen
abstract
“The review of the new TFT panel...”
rating
4
update_date
26-4-2006 17:
Event
Middleware LaboratoryLABMID
■
From an abstract point of view the event schema definesan n-dimensional
event space
(where n is the number of
attributes). ■
In this space each event
e
represents a point.
■
Each subscription
s
identifies a subspace.
■
Each subscription
s
identifies a subspace.
■
An event
e
matches the subscription
s
if, and only if, the
corresponding point is included in the portion of the eventspace delimited by
s
.
Event schema and subscription models
Middleware LaboratoryMiddleware LaboratoryLABEvent schema and subscription modelsMID
■
Depending on the subscription model used we distinguishvarious flavors of publish/subscribe:
Topic-based
Hierarchy-based
Content
Content
Type-based
Concept-based
XML-based
Event schema and subscription models
Middleware LaboratoryMiddleware LaboratoryLABMIDEvent schema and subscription models
■
Hierarchy-based selection
: even in this case each event
is “tagged” with the
topic
it is published in, and Subscribers
issue subscriptions containing the topics they are interestedin. ■
Contrarily to the previous model, here topics are organized
■ in
a
hierarchical
structure
which
express
a
notion
of
containment between topics. When a subscriber subscribe atopic, it will receive all the events published in that topic andin all the topics present in the corresponding sub-tree.
Event schema and subscription models
Middleware LaboratoryMiddleware LaboratoryLABMIDEvent schema and subscription models
■
Content-based selection
: all the data published in the
system
is
mostly
structured.
Each
subscription
can
be
expressed
as
a
conjunction
of
constrains
expressed
on
attributes. The Event Notification Service filters out uselessevents before notifying a subscriber.
Event schema and subscription models
event1:name= Acme cablesvalue=23$
e
e
Middleware LaboratoryEvent schema and subscription models
e event2:name= Acme REvalue=18$
e
Middleware LaboratoryLABMID
Modern ENSs are implemented through a set of processes, called event brokers,
forming an overlay network.
Each client (publisher or subscriber) accesses the service through abroker that masks the system complexity.
Middleware Laboratory
An
event routing
mechanism routes each event inside the ENS from
the broker where it is published to the broker(s) where it must benotified.
Middleware LaboratoryLABMID^ Event routing
Event flooding
: each event is broadcast from the publisher in the
The implementation is straightforward but very expensive.
This solution has the highest message overhead with no memory overhead.
x>
x= x<18 AND x>
x=30 OR x>
x=
Middleware LaboratoryEvent routing
x=30 OR x>
x=
x<>
x<
x>
x>
Middleware LaboratoryLABMID
Filter-based routing
subscriptions are partially diffused in the system
and used to build
routing tables. These tables, are then exploited during
event diffusion to dynamically build a multicast tree that (hopefully)connects the publisher to all, and only, the interested subscribers.
x>
x= x<18 AND x>
x=30 OR x>
x=
Middleware LaboratoryEvent routing
x=30 OR x>
x=
x<>
x<
x>
x>
Middleware LaboratoryLABMID
ANY
a^
x>=30 OR (x<18 AND x>10) 5
ANY
1
b^
x>=30 OR (x<18 AND x>10) 3
ANY
Filter-based routing
subscriptions are partially diffused in the system
and used to build
routing tables. These tables, are then exploited during
event diffusion to dynamically build a multicast tree that (hopefully)connects the publisher to all, and only, the interested subscribers.
x>
x= x<18 AND x>
x=30 OR x>
(^3) x=
ANY
1
2
6
x>
8
x<
9
ANY
e^
ANY
5
x>10 OR x<
d^
ANY
9
x>10 OR x<
f^
Middleware LaboratoryEvent routing
x=30 OR x>
x=
x<>
x<
x>
x>
9
ANY
3
x>=30 OR (x<18 AND x>10)
7
x>
5
ANY
Middleware LaboratoryLABMID
ANY
a^
x>=30 OR (x<18 AND x>10) 5
ANY
1
b^
x>=30 OR (x<18 AND x>10) 3
ANY
x>
x= x<18 AND x>
x=30 OR x>
x=
Middleware Laboratory
3
ANY
1
2
6
x>
8
x<
9
ANY
e^
ANY
5
x>10 OR x<
d^
ANY
9
x>10 OR x<
f^
Event routing
x=30 OR x>
x=
x<>
x<
x>
x>
Middleware LaboratoryLABMID
9
ANY
3
x>=30 OR (x<18 AND x>10)
7
x>
5
ANY
Rendez-Vous routing
: it is based on two functions, namely
and
, used to associate respectively subscriptions and events to brokers
Given
a
subscription
s
SN(s)
returns
a
set
of
nodes
which
are
responsible for storing
s
and forwarding received events matching
s
to
all those subscribers that subscribed it.
Given an event
e
EN(e)
returns a set of nodes which must receive
e
to
Event routing is a two-phases process: first an event
e
is sent to all
brokers returned by
EN(e)
, then those brokers match it against the
This approach works only if for each subscription
s
and event
e,
such
that
e
matches
s
the
intersection
between
EN(e)
and
SN(s)
is
not
empty
Middleware Laboratory
that
e
matches
s
the
intersection
between
EN(e)
and
SN(s)
is
not
empty
( mapping intersection rule
Middleware LaboratoryLABMID^ Event routing