With more and more AJAX applications popping up, I am seeing this and solving this problem often. It is well known in the thick client world that to keep thick clients over the network in the same state you have to use a Push Architecture with a messaging architecture in the back end. Let's take a look at the most common example on an application that needs to keep state synchronized across all clients, the Dashboard.
The Dashboard is usually a table (sometime something much more complicated) that contains information that is updated in real time by other clients and other services. For example, imagine a trucking company that has a table that contains all their trucks, who is driving their truck, what the truck is carrying, where the truck is going is going and the truck estimated time of arrival to its destination. This information is vital to the dispatchers to allow them to know what truck will be available when and where. Then they can make the most efficient use of the trucks on the road.
The trick is to keep this tables synchronized across all the clients without having the clients poll the database every x seconds to see if there are any changes. Such strategy simple does not scale. What you do in this case is you set up a messaging server in the back end like JBoss Messaging or TIBCO, create a topic in the Messaging server that all the clients subscribe to and then every change made to the table by clients, or maybe a GPS service, is published to the topic and all clients get a new message and update their table. This is a more efficient model.
How do you achieve a similar push architecture with AJAX? It is easy to create a dynamic AJAX table that updates itself asynchronously without ever resubmitting the page. You can do it with straight Javascript and HTML, or you can use a library like Google's GWT or DWR. The problem is that the AJAX page will eat up your server resources. By constantly polling for changes, you will have constant queries on your database when they are not necessary. But, how do you implement messaging with AJAX?
If you want to make your life easier, use Apache ActiveMQ as the JMS provider.
ActiveMQ provides Javascript remoting objects for the AJAX pages to listen for messages asynchronously. If you want to use another framework or JMS provider, you will need to create a POJO or servlet on the server side that writes and listens to the JMS topic, and the remoting Javascript objects need to listen to events from that POJO or servlet. JBoss is working on a similar feature for their JMS product. TIBCO also has AJAX libraries and support.
With all the messaging support for messaging and AJAX in the market, there is no excuse to use Pull Architectures in AJAX clients anymore.
Email me if you need more details.
It's really not fair to list this one because the site I'm referring to is still in development. It should launch in the next few weeks. I list it because it's going to be very "top 5" worthy when it launches.
Posted by: buy kamagra | April 23, 2010 at 11:32 AM
A great man is always willing to be little.
Posted by: new jordans | November 05, 2010 at 07:56 PM
How wonderful! Break a leg!*
Posted by: coach outlet | November 08, 2010 at 07:38 PM
Greetings to all! Incredible, I'm really fascinated with this article, which has long had the opportunity to read something so interesting and so effective that contains, for me, blogs have become an important part of my daily life, all day before going to bed I read a few. I love design and am interested in learning more about how you project.
Posted by: Impotence causes | November 09, 2010 at 11:38 AM
A very warm greeting to all readers, thank you very much for allowing us to express ourselves in her blog, I am a complete pleasure to have the opportunity to have such a fabulous read an article like this, I think the world should do more awareness about what our children read on the Internet, issues like in this article are those who can create in the young a better neurological performance.
Posted by: Cheap viagra | November 12, 2010 at 08:30 AM
What an astounding article…great… something as amazing as this never crossed my mind…..Thumbs about to your curiosity!!! Congratulations for your achievements, I really hope to see more such articles in the future.
Posted by: Generic Viagra | February 16, 2011 at 03:08 AM
i agree with your views from here.
Posted by: Nike Shox | April 20, 2011 at 08:30 PM
Thank you! It's really not fair to list this one because the site I'm referring to is still in development.
Posted by: ClubPenguinCheats | June 30, 2011 at 02:07 AM
I really love it. Thanks for sharing this post.
Posted by: Arthur Lopez | July 29, 2011 at 03:50 AM
Hello.This article was really motivating, especially because I was looking for thoughts on this issue last couple of days.
Posted by: car wraps jacksonville | August 06, 2011 at 11:49 AM
Thanks for the write up! This is really some great stuff here! Wishing for a following post for the similar subject.
Posted by: Ken Griffey Jr Shoes | August 12, 2011 at 06:19 PM
I seriously appreciate your website but make sure you check the grammar of your articles or blog posts. A number of of them are rife with spelling errors and I believe it is very difficult to be honest however I probably will come back again.
Posted by: Danzel | September 27, 2011 at 09:02 AM
Thank you for the great advice. I'll try using Apache ActiveMQ now.
Posted by: car cardiff | October 18, 2011 at 07:03 PM
so good
Posted by: ugg boots on sale | October 24, 2011 at 01:09 AM