Server Side Push and Comet

August 10, 2007

At my current project at work, we need the ability to push events/data to clients using a typical web application which already has some XHR elements in it. Our current approach has been to use a Java Applet and let it make a socket connection back to the web server. This persistent network connection allows us to send events to the client, independent of client’s own requests. However, this solution is not super clean, mainly because applets are old-school and it takes an insane amount of effort to maintain the applet-JavaScript communication.

So, I set up on a quest to find other technologies available for server side push, and came across Comet. Comet is essentially a style of programming that allows event-driven server-side push data streaming. The best example of Comet is Google Talk inside GMail. Zhou Renjian has already cracked this and created a plain JavaScript implementation. There is no dearth for implementations of this technology. However, none of those fit our needs exactly.

Fortunately, many web containers are already beginning to realize the value of such technology. Most of the major containers look like they will have support one way or another in the near future. Jetty is working on continuations. Tomcat is introducing a CometEvent. WebSphere is relying on DOJO. Weblogic has an AbstractAsynServlet.

In any case, I ended up using a persistent XHR connection between the server and the client. This worked like a charm, although I haven’t been able to test the scalability part of it yet. Fortunately , or unfortunately, our project does not have high performance expectations, and so it will take some more time until I can figure out the scalability aspect of this solution.


10 Responses to “Server Side Push and Comet”

  1. Thanks for very interesting article. btw. I really enjoyed reading all of your posts. It’s interesting to read ideas, and observations from someone else’s point of view… makes you think more. So please keep up the great work. Greetings.

  2. Thank You for another very interesting article. So please try to keep up the great work all the time.

  3. yellowpages Says:

    Wonderful Article i enjoyed reading it, thanks for sharing with us!

  4. Kunst Says:

    There are many useful informations in this article. Thanks and greetings from Thuringia!

  5. Good stuff. Thanks and greetings!

  6. I really enjoyed reading all of your posts.

  7. Gira Says:

    Are there new informations about the performance?

  8. Marder Says:

    There are a lot of god informations in this article. Thanks and greetings from Germany!

  9. Umzug Says:

    Good article. Thanks and greetings from Thomas!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: