Which BOSH Server Do You Need?

September 8, 2008

If you’ve decided you use BOSH for an XMPP enabled Web service or to allow Web based XMPP clients to connect to your server, you’ll find that you have a couple of choices. For starters, there are two kinds of BOSH connection managers - built in and stand-alone. What are the advantages of the built in ones, and when should you use a stand-alone connection manager?

:EXTENDED:

Built In BOSH

Several severs now come with built in BOSH support: ejabberd, Tigase, Openfire, and Jabber XCP. These can be enabled in the server configuration and allow BOSH clients to make connections.

Built in BOSH support has several advantages.

This is not the whole story, however. Built in BOSH has significant drawbacks.

If you don’t need to support other XMPP servers, and your XMPP server supports built in BOSH, then your BOSH connection manager choice is easy.

Stand-alone BOSH

There are a few implementations of BOSH that are not tied to a particular XMPP server implementation: Punjab, Araneo, JabberHTTPBind, and rhb. Punjab was originally written by my co-worker, and it is the server I am most familiar with since we use it heavily at Chesspark.

The advantages and disadvantages of stand-alone BOSH connection managers are the same as those above only inverted.

Stand-alone connection managers can make connections to any XMPP server. This means a Web application that is XMPP powered can offer the service to the entire federated network, and it doesn’t even have to run an XMPP server of its own. This server independence comes at the price of overhead. Each client BOSH connections requires a connection to that user’s server. Each BOSH connection usually has two persistent HTTP connections plus a persistent TCP connection to the XMPP server. This is very similar to a proxy server setup.

The other advantage of stand-alone connection managers is their simplicity. Since they have not server-specific logic, they all behave the same way, and this makes scaling them fairly easy. One trick is to run several BOSH servers behind a load balancing proxy like nginx. Tofu has written about this in his blog about the Chesspark BOSH Cloud.

Federated XMPP Web applications need exactly these two advantages. If you’re doing more than just allowing new clients to connect to your existing XMPP server, you probably want a stand-alone connection manager.

What To Do With BOSH

Once you have a BOSH enabled server or a stand-alone BOSH connection manager, you’ll soon discover that XMPP is better with BOSH. What you do from here is limited only by your creativity. You could create real-time Web games, microblogging clients, monitoring applications, or just add chat support to your Web site. The future of the Web is XMPP, and BOSH will help you get there.

Which BOSH Server Do You Need? - September 8, 2008 - Jack Moffitt