users@glassfish.java.net

Re: Push via messaging vs pull via polling..

From: <glassfish_at_javadesktop.org>
Date: Fri, 07 Sep 2007 16:26:05 PDT

It really depends on your clients, your data volume, you overall "activity" and timliness.

On the one hand, you've got things like RSS feeds which typically refresh every 5, 10, or even 30 minutes. They just don't need to hammer the server, or necessarily be that up to date. So that's a perfect scenario for polling.

On the other, you having something simple like a "status bar" monitoring a the progress of a process as it goes from "0%" to "100%".

That's something that would better be served by a push mechanism, because it's important to be as "up to date as possible" and you don't want to hammer the server every second creating and destroying sockets like potato chips.

Then there are the clients. Lots of clients and their internal implementations are MUCH happier with a pull model rather than having random events pound them from the server. Many developers find pure asynchronous programming difficult, and the "fetch the data, process it all, and fetch some more" idiom suits them very well.

So it's hard to recommend one over another.

In a perfect world, it would all be an asynchronous "push" model with instantaneous updates everywhere. But that's easier said than done and can be more expensive than necessary.
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=234507