views:

56

answers:

2

Is it worth using Comet for events that are not needed "in realtime", but with a possible delay of, say, 1 minute. Such would be:

  • twitter status updates
  • facebook updates

I know comet is perfect for a chat application (facebook and GTalk chats are using it), but does twitter, for example, use comet.

Or is AJAX-polling sufficient for such kinds of updates. Why I think it might be sufficient:

  • with a poll-interval of 1 minute you are not putting too much load on the server with the ajax-requests
  • "no new data" is not the predominant result, as in chat apps for instance.
  • no server threads are held and so threads can be reused by multiple clients. Thus a thread pool of 100 threads may be used by 200 clients, whereas with comet it would be 100. (this is not true for my case, using Java - see this article that explains clever thread reuse)

(Note: with "comet" I denote the technique of holding the connection open. Some tend to refer to ajax-polling as comet as well, so I make that clarification - ajax-polling != comet in the above question)

+2  A: 

It sounds like you have answered your own question pretty well :) Another thing to keep in mind is that you won't be filling your DOM up with <script> tags as with some long running comet solutions.

unomi
A: 

The problem with this question is that you seem to be just as qualified to answer as anyone. It's a trade-off one way or the other, and given that you don't tell exactly what you are making it's hard to say which is the lesser evil.

eBusiness
Let's assume it will be just like the two features I mentioned - the twitter and facebook updates coming from the server (when a button "show more" appears)
Bozho
Since Twitter and Facebook are dealing with quite large traffic loads I'd probably call AJAX-polling, unless you can find a way of making servers and network equipment deal painlessly with all the simultaneous connections.
eBusiness
What would "call" mean in the above sentence? :)
Bozho