What is Pubsubhubsub?

Wed, August 12th 2009 at 12:02am

After watching TWIg (This Week in Google) Episode 1 about a week ago found out about Pubsubhubsub. It sounded interesting because it seems like this protocol or something like it is going to be important to Google Wave in the future. I have not had a chance to play with Google Wave yet, but from what I saw its goal is to do everything in real time, including interactions with websites, blogs, forums and comments.

With the current polling syndication system this is impossible to do without polling every website you are interested in multiple times a second. Pubsubhubsub is building on the current syndication spec and adding push notifications to it, thus allowing real time updates from any enabled site with a syndicated feed. In this post I am going to go over a little more of what I have learnt about PSHS and what it does and how to enable it with WordPress.

So What Does it Do?

The traditional syndication model is pretty simple and based on the standard Web model. The subscriber, a program like Google Reader, FriendFeed, or Flock, polls a feed from the publisher on a schedule. Every hour or thirty minutes the publisher is polled to see if there is anything new.

The Traditional Syndication Model

The Traditional Syndication Model

This method has a couple of problems:

  1. Resources: This consumes a lot or resources. Most subscribers have many (hundreds) feeds they are polling all the time, and a site can have thousands of subscribers. So there is a constant polling on a site from thousands of clients.
  2. Latency: There is a big problem with lag time between when a post is made, and when the subscriber receives it. Depending on the polling schedule it could be several minutes or hours before a post is picked up.

Going back to Wave again, this model just would not work. The latency alone is not acceptable for real time updates. One of the Wave demos was to update comments on a blog post in the Wave client. The post to the site was instant, then replys came back to the client instantly from the blog. It was possible to carry on a conversation about the blog post via the comments. This adds comment managing problems, but we will have to sort that out later.

So if the Wave client had to wait for minutes for the syndication to pickup each new comment it would lessen the whole experience.

So Pubsubhubsub tries to inject Push into the current syndication model by adding a third party “hub” into the mix. The hub basically acts like a network hub, it takes information from once source and sends it out to multiple clients. What happens now is that the first time the subscriber reads your feed it is told the address of the hub that is associated with the feed. The subscriber will then register with the hub to get notifications about the publishers feed. Now when the publisher posts a new entry to the feed they also send a notification to the hub the hub then Pushs that notification out to all the subscribers who are registered with that feed.

The Pubsubhubsub Syndication Model

The Pubsubhubsub Syndication Model

This can all happen in milliseconds and allows the subscriber to see new posts to a feed nearly the instant it is added. So for comment feeds on a blog, news posts or even Twitter like services, you can see all the updates right away.

As far as I know this does not work both ways yet, so no instant return postings. But this is early days and I am sure that will come eventually.

Install in WordPress Today!
Please remember everything is very early in development, so use at your own risk.

Currently the only sites that support this protocol are FeedBurner and FriendFeed, but if you use Feedburner this is an important update just because it instantly updates your Feedburner feed when you post. If you use Feedburner without this service then you add Feedburners latency on top of the subscriber latency.

When I set out to update my WordPress themes I actually was getting ready to do some hacking and plugin development, but it seems I have been beaten too it. There is actually already two WordPress plugins that adds Pubsubhubbub to your feeds, and pretty much set it up for you.

These are the two plugins I am currently using:

  1. PubSubHubbub by Josh Fraser: This plugin modifies your feeds to let your subscribers know which hub you are using, and also notifies the hub when you post new items.
  2. FD Feedburner Plugin by John Watson: This plugin forwards your feeds to your FeedBurner urls. In theory Pubsub should work with regular feeds just as well (maybe better?) but I already had Feedburner setup and did not want to uninstall everything for testing.

After you have all that setup you will have to change a setting in your FeedBurner feeds. Under “Publicize” you will need to enable “PingShot” which tells FeedBurner to use push notifications.

You can follow the install instructions for the plugins and use the Pubsubhubsub site for more up to date information.

Once you get everything working when you add a new post to your WordPress site you should be able to refresh your FeedBurner page and see the post immediately. Then as new sites add support they will receive push notifications from FeedBurner and get update right away too.

Wrap Up

This has been one of my longest posts ever, but it makes me excited when I think about what Wave and projects like PubSub are trying to do to the internet. These kind of architectures are really starting to show some glimpses of what we have in store, and I think it is an exciting time for geeks and Internet users alike.

Tags: , , , , ,

4 Responses to “What is Pubsubhubsub?”

  1. NickNo Gravatar says:

    I watched FeedBurner and FriendFeed when I posted this. FeedBurner updated right away within 2 seconds, FriendFeed did not. Not sure if it’s implemented on FF yet.

  2. onelargeprawnNo Gravatar says:

    I see there is another pubsubhubbub wordpress plugin available that is compatible with the latest version of wordpress – http://wordpress.org/extend/plugins/wp-pubsubhubbub/

    Should we use this rather?

  3. NickNo Gravatar says:

    It is certainly an option, the one I am using was linked to by the PHS website so I used it. I have not used the other so I can not say.

    On the our side of it the plugins are actually quite simple, they just add a address for the hub into our RSS feed, and ping the server when we post. So they should work fine.

  4. NickNo Gravatar says:

    As an update my feed is currently not working with FriendFeed. I spoke with a PHS developer and there is a bug with FeedBurder and My Brand. They are working on it, and it’s not related to the WP Plugin you choose.

    But it does work fine with FeedBurner directly, and that is important in itself. Now we can let them work out compatibility problems.