Rocket Science and Plumbing

The AJAX meme continues to percolate on the internet, with a nice summary article from QuirksBlog that links to some of the more interesting analysis. Geeks everywhere seem fascinated by the fact the XMLHttpRequest can be used to fetch data behind the scenes and serve it up when the user asks for it.
XMLHttpRequest is a handy and mildly interesting bit of plumbing. The fact that it’s a fairly simple API that you can read about and comment on makes it handy blog fodder. But the real differentiator in all of the new google applications is NOT in that they use XMLHttpRequest (they could easily use an iframes hack instead, as an earlier commenter on my site pointed out). They could even have used Flash!
The client-side predictive engine that google has built into their new applications is what really makes them powerful.


Let me explain. Gmail feels fast to users because it works behind the scenes to fetch the data you want before you request it (using XMLHttpRequest! Yay! Go AJAX!). This leads to a better user experience, because when you decide to open up a particular email message in gmail, the data is usually in RAM on your computer, instead of on a hard drive on a server somewhere.
But how did Google know that you were going to open that email, instead of a different one? Doesn’t anybody find it remarkable that google knows what you’re going to do before you yourself do?
First, lets clear the misconception that they’re doing something as simple as downloading ALL of the data. Gmail can’t download your entire email inbox because A) It would take too much time, and B) it would cost google too much bandwidth. In latency must die I described a simple economic model for deciding which data should be downloaded by an RIA: suffice it to say that downloading unused data gets expensive fast, especially for a web-scale application like gmail. So they aren’t doing that.
Google can only afford to preload the emails that have a high probability of being requested by the user. The code that decides which emails to download must be written in javascript and embedded into the gmail web application: we’ll call it the “Predictive Engine”.
I have no doubt that the predictive engine in gmail is based on solid user metrics: google often measures user behavior on the live site and uses that data to improve the site.
I’m sure that metrics on how users use gmail have been collected by google since before the initial gmail release. This information is surely being fed back into the predictive model that downloads onto your browser every time you launch gmail. Slowly but surely, the google gmail team is building a predictive engine that knows precisely which emails people are likely to open. It’s even possible that the refinement of this predictive model was the reason Google chose to release gmail in such a slow, viral way (allowing them time to measure user behavior on the live system and improve the javascript predictive engine while they still had a reasonably small user base).
This is the real rocket science. This is the stuff RIA/AJAX developers should be staying up all night working on. The rest is just plumbing.

One thought on “Rocket Science and Plumbing

  1. Joey Pinder March 24, 2005 / 4:46 am

    How does a plumber use science

Comments are closed.