Thursday, March 09, 2006

I attended Alex Russel's Etech talk entitled "After AJAX: Low-latency Data to (and from) the Browser". (Slides posted here.) The premise was pretty simple. Now that we have client initiated asynchronous event and data exchanges between the browser and the server we should extend that work with something that can be initiated by the server. We'll the server, for various reasons, can't just make an http request back to us because we're not technically running a server in our browsers. So what would Mr. Russel have us do? Open a connection to the server and leave it open for the length of our browser session and use that as a communications channel the server can pump down XML messages. He's named this technique Comet. The technique is not fundamentally new since you can do this with a number of other techniques, HTML frames, image SRC attributes, hell even hidden Java applets will work on some browsers, but the problem I have with the technique is the cost you pay on the server side. Ajax is successful because it is a client-side technology that does wonders for user interaction but it doesn't require any fundamental server side change. Comet on the other hand, and most of these techniques that require a long-lived browser connection stress the web server in ways it was not meant to be stressed. A web server, and the HTTP protocol, was meant for client initiated requests for information. (client: Give me this. server: Here you go. Good-bye.) So by using these techniques you essentially gum up the works of standard web servers. So to effectively use the technique you've got to either modify the web server your using or have you client code connect to a completely different type of server. That's kind of a high price to pay. But I guess if your application really needs these types of real time updates this technique may work for you. In the past I've seen people solve this with Flash, using the proprietary server, or with a Java applet communicating back to a server written in Java or any other language. So again not much new, or emerging about the technique or the implementation other than it's done in javascript.

Technorati Tags: , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home