Published on 2006-03-14 22:21:19

It's not the first resources issue we had with this hosting provider and we used to move from a publishing plateform to another many times before finding the suitable configuration for both. But what makes me sick is that monday I discovered that there was dns problems with the server, after contacting the support service I discovered also that they have moved my website without informing me, but also used an old backup. There was about 8 articles lost and I don't know what else since I didn't have time to make a backup myself. Moral of the story, we can't keep the AJAX demos for long time, and if you plan to use AJAX don't do it on shared hosting.

Concerning the AJAX and AWS demos, I just wanted to show the features that we can create using the Amazon WebServices. But the basic of the scripts are a little resources consuming since everytime the client make a request, the server call the remote Amazon method to fetch data then process it locally to send it back to the client.

ajax-aws.png


The problem is that this process is created for every AJAX request, for example in the first demo using search with keywords for every keyup event the server will make a remote request to Amazon fetch the data process it and send it back. As result we will have a very flexible interface but in the other side a very busy server, you can imagine this process running by many users in the same time.

The solutions are many, first we can work on the interface itself for example use a search submit button inspite of the keyup event. Catching the even make a very nice effect, but we are not sure that the user have finished writing his keyword, so we are already creating more requests than needed. The same for the slider, if you click on the slider and keep moving right and left, an AJAX request is send for every step, which mean if you move from 0 to 20 the script can make 10 requests at 2,5,8,10,12 ... while the price we are looking for is 20.

This is for the client side, in the server side it's possible to use caching for the results so for one keyword request you make only one remote request to AWS every 24h for example. If the user requested the same data again, the server will retrieve it from cache, which will be faster and less resources consuming.

These are some thoughts to optimize the latest demo I have created for using Amazon Web Service with AJAX, and I'm sure that we'll have more technical articles in the future discussing different aspect of AJAX solutions.

Previous Page


Related Entries

Member of the PHP Magazine Network, Copyright (C) 2005-2008 phpmagazine.net All Rights Reserved