[standards-jig] Pub/Sub Explanation

Peter Saint-Andre stpeter at jabber.org
Tue Apr 16 16:59:52 UTC 2002

On Tue, 16 Apr 2002, Dave Smith wrote:

> Frankly, what I'm hearing from DJ and piers is the requirement for a
> light-weight notification system -- and maybe that's a truer definition of
> "pub/sub". What I am proposing is a system which is a super-set of the
> functionality there...a sort of "persistent pub/sub". There's certainly no
> reason why a system such as I described can't implement the functionality
> described in JEP 24.
> With this in mind, perhaps we can agree that these are two separate systems
> and as such should be pursued independently of each other.

Most books and resources on software design patterns talk about something
called the Observer Pattern, and equate that with publish/subscribe 
(http://www.inf.fu-berlin.de/~bokowski/Observer.html has a good description
even though it seems to be pulled word-for-word from "Design Patterns"
by Gamma et al., which rubs me the wrong way). In the Observer Pattern,
a dependent (or "subject") is notified of changes to an object. This is
straight notification, and a service that informs multiple subjects of 
changes to one object could be thought of as an event notification relay.
This seems to be what DJ and Piers have in mind for pub/sub, and it is
fairly common usage.

With pure event notification, it is the responsibility of the subject to
poll for the content of the change. We might also have more of a push
model for certain kinds of content, or a hybrid model. To me, whether
we have pure pull, pure push, or hybrid depends on what kind of data
is being published. Think of a simple pub/sub system for weblogs. I
could be notified when your blog changes and then I have to pull down
the URL for your latest story. I could be notified when your blog changes
but also receive an abstract of the story, thus helping me decide if I
want to pull down the story. Or I could be notified when your blog changes
and also receive the story (in band). Are those different subscription
types to the same topic/channel? Is pure pull equivalent to pure event
notification (no data storage) whereas pure push requires data storage? 
I definitely see a need/desire for a range of options here depending on
user preference and data type (e.g., large vs. small content, structured
vs. binary).

Well, those are just random thoughts, hopefully someone finds them of use.


Peter Saint-Andre
email+jabber: stpeter at jabber.org
weblog: http://www.saint-andre.com/blog/

More information about the Standards mailing list