AJAX-Design Tutorials
AJAX-DesignPoll vs. Push Technology
There are two ways in implementing client side notification. The first technique is to use “push” technology from Ajax. This programming technique in providing updates to the user could be done through simple JavaScript notification coding.
Polling on the other hand could be fully implemented using Comet. Although regarded as the more powerful programming technique compared to Ajax, it is basically a variety of Ajax seen as an aggressive version of the programming technique. Polling provides real time notification for users through consistent updates from the server.
These techniques could be fully implemented on certain scenarios. Here are their pros and cons.
“Push” from Ajax
Pros:
The familiarity of Ajax is undoubtedly there. Frameworks and scripts based on JavaScript exist with an impressive number of variations. Developers who are familiar with JavaScript could easily implement client side notifications in an instant simply because they are already available.
On the other hand, creating a code from the scratch is not challenging at all. Developers should be able to create a notification tool for the client side since it simply monitors the activity and notifies the user when those actions happen.
Cons:
Client side notification using “push” from Ajax requires an open HTTP. This is a separate HTTP which means it could double the required resources for the application. Additionally, the real time notification tool is not real time at all. Since it goes through HTTP, they are practically two websites communicating with each other and this could easily slow down the application.
Poll from Comet
Pros:
Comet is regarded as one of the most powerful programming techniques – for a good reason. Using server push, Comet will be able to provide real time interaction with users without any problem at all. Instead of simply using the client side as its main resource, Comet will require the server to be powerful enough to push the data. This means Comet will utilize all resources possible to ensure that the application will work as expected.
Cons:
The challenge of polling in Comet is based on two things: first, the current hardware of simpler gadgets is not powerful enough to deal with Comet. Ajax today cannot be easily handled by smaller gadgets so the possibility of dealing with Comet is very remote. But Comet could be great if the environment is highly controlled where the hardware could be specifically built for aggressive programming languages.
The second challenge of polling is the possibility of clogs. Notification will only be possible when requests are made from the client side. But to be able the real time notification, consistent requests should be made. This often creates clogs wherein too much request is being received from the server side. Obviously, the answer to this concern is to delay the request which will naturally delay notification. But this setting only defeats the purpose since the push technology from Ajax could do this and resources are plenty.
Poll and push offer distinct advantages and disadvantages. But whatever process you choose, always consider your end user who will ultimately spend a lot of time using the application.
Sponsored Links
