Readers: 19 | Updated: 07-25

OSCON day 1: Beyond REST? Building Data Services with XMPP PubSub

Translate Into:

Its good to be back in Portland for my favorite geek convention: O'Reilly's Open Source Conference. The overcast sky in Portland is making it a little easier this year to focus on the plethora of excellent speakers and sessions. The first session to really grip and and speak to me was Rabble and Kellan's "Beyond REST? Building Data Services with XMPP PubSub" presentation.

They started out their presentation stating that they were not "Jabber Heads", but that they were in the business of building web sites. For Rabble and Kellan, Jabber presents one more tool in their huge tool-chest to build web sites. Jabber wasn't designed to be a part of a functioning web site, but they insist that it works great for building social web sites that require many people to be notified of updates.

For example, Kellan talked about FriendFeed, a site that lets their users know when their friends share new items. In this example, Kellan pointed out that FriendFeed polls Flickr 2.9 million times in order to check on updates for 45 thousand users. And of those 45 thousand users, only 6.7 thousand are logged in at any one time. This of course, its a poor way of checking for changed content. Kellan says: "Polling sucks!"

To solve this problem its key to leave standard REST web services behind and find a way to use message passing, which is a direct communication way of notifying users of changed content. The open and mature infrastructure that Rabble and Kellan found to use for this service is Jabber. Jabber has 10 years of experience of passing messages around the internet and has been embraced by many companies including Google.

XMPP, Jabber's protocol, works well for message passing and does not have many of the problems/limitations of HTTP:

  1. XMPP works over persistent connections
  2. It it stateful (SSL becomes cheap)
  3. Designed as an event stream protocol
  4. Natively federated and asynchronous
  5. Identity, security and presence are built in.
  6. Jabber servers are built and deployed to do this stuff.

Given this, Kellan and Rabble decided to piggy-back a notification system on Jabber by sending XML fragments using a PubSub paradigm. In this context, PubSub is a simple method for passing XMPP pubsub stanzas via Jabber. PubSub is nothing more than a convention for how to send XML via Jabber, including a method for embedding Atom fragments in the XML.

Rabble presented using XMPP for FireEagle, Yahoo!'s new personal geolocation service that allows users to provide their current location to other users. For a few users and a few updates you can paginate the data stream into RSS/atom feeds. But once you have more than a few users and frequent updates a paginated stream cannot keep up. What if a user publishes more updates than can an RSS feed can capture? Updates get lost -- and for applications using FireEagle missing an update presents a critical flaw. Using a system like XMPP, FireEagle can rely on Jabber to deliver all the updates -- exactly what Jabber was meant to do.

Kellan also applied XMPP/PubSub to Flickr and how a Flickr update "Firehose" might work. If Flickr sends a ~2k an atom enriched packet for each new public picture posted at a rate of 60 updates a second, it would take roughly a megabit of traffic. Even a normal DSL line can handle one mbit of traffic, so the network effects are manageable on this level, compared to the polling system that FriendFeed uses. (Kellan also points out that FriendFeed is not doing anything wrong at all -- the current web service centric model is simply insufficient for this type of service.)

To deploy your own message passing service based on XMPP/PubSub, you'll need to follow these 4 easy steps:

  1. Get a Jabber client library. There are many available for all the popular languages.
  2. Set up a Jabber server -- again there are many available to choose from. Turn off the features you won't be needing. (e.g. creating new accounts)
  3. Build a component (according to Jabber XEP-0114)
  4. Integrate the message passing system in your own site.

Pretty simple, overall! The beauty of this approach comes from the fact that all off-the-shelf components were used to build this new notification system. No new magic technology is being created to enable this system, which is a personal metric of mine for determining the likelihood that a new system will succeed.

It's clear that REST web-services provide the heavy lifting for many Web 2.0 sites, but its also clear that REST and its inherent polling mechanism isn't the best way of building a user notification system. With social networking sites not about to fade away, we're going to see an increasing need for capable message passing sites. And since Jabber is a well established and supported system, it only makes sense to piggyback on this great technology. Thanks for the awesome presentation Rabble and Kellan!

Update: Rabble posted the slides for this talk.

(And a big thanks to Tim O'Reilly for letting me guest blog OSCON here!)



From The Blogs

Personal Development with The Positivity Blog

04-18
7 ways to move beyond procrastination
Almost everyone is held down by what some call “the silent killer”. Procrastination strikes everywhere. We all want to avoid the pain or discomfort of doing something we feel is boring, stupid, pointl... 查看全文

ReadWriteWeb

03-08
Web Technology Trends for 2008 and Beyond
Today I gave a presentation at the Media08 event in Sydney, entitled: What’s Next on the Web? Web Technology Trends for 2008 and Beyond. It's an overview of some of the top trends we cover on ReadWrit... 查看全文

b5media Travel and Culture Channel Feed

06-18
Oscar Wilde: Living Beyond His Means At L’Hotel [The Paris Traveler]
I suppose that I shall have to die beyond my means.  Oscar Wilde    I am a bigger fan of Oscar Wilde than I thought.  Doing some research into his literary career, I discovered that I have read half o... 查看全文

Brazen Careerist by Penelope Trunk

04-16
How to get a job that’s way beyond your experience
The jobs that are the most fun are where our learning curve is high but we can still achieve results. Usually the list of requirements for a job like this is a little beyond your experience. So how do... 查看全文

Blogging Tips

05-01
Is Your Online Information Business Ready to Grow Beyond You?
I’m going through an interesting phase with my online business right now. It’s growing, which is good. But, it’s also making me feel scattered, not quite as pulled together as I usually am. As with ev... 查看全文

UXmatters

03-14
Wheres My Stuff? Beyond the Nested Folder Metaphor
By Paul J. Sherman Published: March 12, 2008 As Imentioned in my inaugural column, Envisioning the Future of User Experience, I often have difficulty remembering where I put my digital documents and f... 查看全文

Download Squad

03-29
Beyond Nike + iPod: Apple's new fitness project
Filed under: Business, AppleIf you liked the iPod/Nike+ gadget to help you with your runs, you may be excited to know that was merely the beginning of what seems to be a much larger pie Apple has been... 查看全文

The Paris Traveler

06-20
Oscar Wilde: Living Beyond His Means At L’Hotel
I suppose that I shall have to die beyond my means.  Oscar Wilde    I am a bigger fan of Oscar Wilde than I thought.  Doing some research into his literary career, I discovered that I have read half o... 查看全文

Celebrities - Channel Feed

06-20
Benji Madden is Beyond Happy with Paris Hilton
Benji Madden is quite thrilled with his girlfriend, Paris Hilton, and says she drives away all his worries!! “I’m so beyond happy,” Benji says …he’s even starting to sound like her!“When you are that ... 查看全文

爱枣报

07-15
beyond,我不忘[枣听特刊]
1983年,BEYOND乐队成立,开始了此后25年不曾停歇的歌唱,带着所有的骄傲。 1993年6月30日,BEYOND的灵魂人物——黄家驹永远离开了,带着所有的梦想。 坦白讲,我接触BEYOND时也不... 查看全文
More Articles