What is it ?

Most of the modern web applications display recently updated data, and to do that they need to get he latest data very frequently. Some of them even include some real-time chat (Gmail Chat, Facebook chat).

How ?

That’s the interesting part.

So pushing data isn’t very complex, it just requires a special server to transmit some data (text, html, xml, or image) over an already opened HTTP connection.

Why do we need some special servers ? Because our current servers aren’t build to make people wait. Some geeks made some example of PHP code being able to make some Comet response but they all use looping usleep. If you used it, you would end up totally killing your server with the growing number of clients.

This is the very interesting part of Comet : It doesn’t consumes more resources, it just requires additional server software.

Two types of push

They are two types of push :

How do do some push enabled web applications

You rethink your software so that it uses the push server.

On PHP, you can use The Ajax Push Engine.

On pure .Net environnement, you can use WCF WsDualHttpBinding to serve data.

The CometD is a stable opensource comet server project. JQuery and Dojo can consume it.

You have LightStreamer, a commercial product with a free license. It can be connected with nearly anything (the only unsupported type of server seems to be PHP) or StreamHub which has a very restrictive free license.

Why some people still use Flex ou SilverLight ?

Http push / Comet requires a complex parallel server infrastructure and it only solves the push (server to client realtime data transmission) problem. When data is received, you still have to treat and display it. Managing this is a lot harder with javascript than it is in Flex ou SilverLight.

By the way, on flex, silverlight, flash, java applets you can use your own sockets to transmit data. This is a very good solution, there a good chance it will consume less bandwidth. But you have to remember that not using the HTTP protocol can create some problems as some companies block every other protocols on their internet gateways.

W3C is on it !

W3C is thinking about adding a WebSocket specification. This could be a very good thing as it would standardize this non-standardized part of the web.

Push outside the web

Push isn’t a web specific concept. Any instant messaging service (like MSN, Jabber, Yahoo or ICQ) does support push.

Any system supporting sockets enables you to make push enabled applications. If you consider the mobile OSes, they all support socket, so they all support push. Androïd supports push by socket, J2ME supports push by sockets, iPhone supports push by Apple push system or sockets and it seems BlackBerry supports it by the BlackBerry push service or sockets.