W AJAX pattern, an improved Multi-stage Download pattern?

by Hari K. Gottipati

An interesting approach to reduce the response time while dealing with 3rd party data can be found here as a W AJAX pattern.

This reminds me the Multi-Stage_Download pattern which quickly downloads the page structure with a standard request, then populate it with further requests. But Multi-stage Download pattern deals with the huge data(not necessarily from 3rd party data) and displays them in chunks. W AJAX pattern deals with the 3rd party data where your web server talks to the 3rd party server to get the data. In this pattern you make the non-blocking request to your web server which opens the thread to the 3rd party server for the data and returns the web page without waiting for the 3rd party data. Browser sends further request asynchronously to the web server for the 3rd party data and then renders that in the web page.

The only difference between these two patterns is making the initial request for the chunk of data and the further request for the next chunk vs. making the initial request for whole data but return the first chunk after opening a thread in the background to fetch the next chunk and then present next chunk in further request. In second case you are reducing the processing time for next chunk as it is already in process in background since the first request made.

I think this definitely reduces the response time compared to Multi-stage download approach. What do you think? Share in comments.

4 Comments

Sarah
2006-07-16 03:43:21
The only difference between these two patterns is making the initial request for the chunk of data and the further request for the next chunk vs. making the initial request for whole data but return the first chunk after opening a thread in the background to fetch the next chunk and then present next chunk in further request.
victor
2006-07-17 02:45:58
Mmmmm... chunky beacon!
Kit
2006-07-17 07:23:06
Trying to synchronise threads like this scares me a bit.


I would prefer using a buffer of some sort. The webapp client and webapp server can both be clients of the 3rd party web service. The difference is that the webapp client puts any data received from the 3rd party onto the UI, while the webapp server puts it into the buffer, to be collected at a later time by the webapp client.


This does restrict a bit the sort of data the service can return, but it avoids having to manipulate threads to handle background data loading which is better IMO.


Kit

Giorgia Palmas
2006-11-14 10:22:48
Interessando, luogo abbastanza luminoso, penso +5