Subscribe

Ajax and the rise of Web 2.0

The Internet`s evolution is creating the foundation for an extraordinary future.
By Toby Kurien, ,
Johannesburg, 25 Oct 2007

Quietly, insidiously, and without users necessarily being aware of it, the Web has evolved from a vast, near-limitless platform for serving content, to one for delivering applications.

This evolution is driving social revolutions, creating an entirely new vocabulary, and laying the foundation for an extraordinary future.

This dramatic change in the Web has taken place over the last seven years - since the collapse of the e-bubble, in fact. It is what people today refer to as Web 2.0.

Coined in 2003, the term was until recently seen as little more than a marketing gimmick, something real technologists didn`t really take seriously. But it has become increasingly clear that we really are living in the era of Web 2.0 - and the defining characteristic is that today it is an application platform, rather than an information platform.

This is in line with the overall drive towards services on the Web, rather than client-side applications. These services are invoked on demand, rather than residing permanently on a hard drive, where they consume space without adding value.

Defining moments

To put it into perspective, Web 2.0 is to Web 1.0 as Google is to Netscape: each defined the Internet for a period of time. Where Netscape gave us the browser, Google has given us a profound window into the Web, along with seemingly limitless ways of using it.

The spectacular success of Google has been followed by any number of applications now available on the Web, many of them social networks. On top of the pile, for now, is FaceBook, the application that has defined the genre.

With breathtaking speed, other applications have emerged, so many that it is almost a full-time job just to track them: YouTube, MySpace, Wikipedia, Meebo, Delicious, DIGG, LinkedIn, Wordpress, StumbleUpon ... the list is seemingly endless; and it`s going to keep growing.

These applications are typical of the concept known as the rich Internet application, or RIA, which brings the look and feel of desktop applications to the Web. These applications transfer user interface processing to the desktop while leaving the bulk of the data on the application server, which can be anywhere in the world.

This concept invokes memories of the mainframe era, when terminals had little intelligence, and intelligence, along with data and logic, resided on the mainframe. The difference today is we have extraordinary processing power on both the desktop and the server, cheap and limitless storage, and really high-speed bandwidth becoming freely available.

Rich rewards

To put it into perspective, Web 2.0 is to Web 1.0 as Google is to Netscape: each defined the Internet for a period of time.

Toby Kurien is a senior software engineer at Cambrient.

Behind this phenomenon is Ajax, a development technique used for creating interactive Web applications. Ajax stands for Asynchronous JavaScript and XML, and the three components of the term are all instructive:

* Asynchronous, in that data retrieval from the server is done in the background, and the Web application continues to function even while it`s waiting for the data (a technique known as non-blocking data retrieval).
* JavaScript, as it is the programming language in which Ajax function calls are made.
* XML, as the markup language used to format data retrieved using Ajax.

Ajax has enabled RIAs as it is deployable across computer architectures, across operating systems, and across browsers. This makes it ideally suited to the Web, where all platforms must be accommodated. Previously RIAs were only possible using a technology such as Flash, which among other problems, has long load times, and is not search-engine-friendly.

The technique has been around for more than a decade, but the term Ajax has only been in use for the last two years. Ajax, in essence, overcomes the page loading requirements of standard Web pages: those controlled, or mediated, by the HTTP and HTML protocols.

Visual impact

Ajax has laid the foundation for complex, dynamic, data-centric user interfaces in Web pages.

Here`s an example of how it works:

* You`ve almost certainly used Google Maps, or the Gmail Web client, and noticed that you can scroll over the map or spellcheck text, instantly, without page submits. That`s Ajax in action.
* As you scroll around the map, JavaScript is used to reposition the map image in the browser. When scrolling into an area that hasn`t been loaded yet, an Ajax call is made to the server to retrieve the image and other data (such as saved locations) for that area of the map. The application continues to function while the image is being retrieved. As the image loads, it is displayed in its appropriate block (even if you are not currently viewing that area).

This is important. Inherently on the Internet, Web pages are loosely coupled, as the data they display is not tightly bound to data sources. This means Web pages have to be reloaded each time they are presented to a user. Ajax overcomes this limitation and makes a loosely coupled Web page appear to the user like a tightly coupled application.

As Ajax generates the HTML locally, within the user`s browser, and only downloads actual data, Ajax Web pages load much more quickly, enabling the appearance of Web-based applications.

Ajax allows a Web browser, in response to some user input or a timer, to retrieve some XML data from the Web server, and then use the data to update arbitrary parts of a Web page/application. For example, a Web page could have a running stock ticker on its home page, with a timer causing the browser to periodically fetch the latest stock prices and then updating the stock ticker, as is used on the Bond Exchange Web site.

For those interested in exploring Ajax, here are some places to begin:

Ajax on the server side:

* Google Web Toolkit for Java
* DWR for Java
* Microsoft asp.net Ajax toolkit for .NET

Ajax on the client side:

* Dojo javascript library
* Prototype javascript library

In the next Industry Insight in this series, I will look at why technologies like Reverse Ajax could be used in making Web-based applications available on cellphones and other mobile platforms.

* Toby Kurien is a senior software engineer at Cambrient.

Share