I am trying to create a "live" browser environment, meaning if something happens on one client, all clients currently on that page will see the changes in as close to real time as possible.
What exactly are my options?
AJAX Short Polling
I have though about using AJAX with really short polling times (~50ms), but I'm not sure if a server can handle multiple clients doing 50 ms polling. That's 20 polls per second per client, which in a 100 client environment, means the server is being POLLED 2000 times every second. Don't forget this is just polling only, not even the fact that the server will be sending out replies to all of these clients.
Comet Programming
Another option was something called Comet, which I hope some of you are familiar with enough to give me some feedback. In short, Comet programming is the ability to have a server push data out to a client (or multiple clients) who are currently on a webpage without requiring them to poll. The benefits of this?:
Well the benefits are quite clear. With 100 clients, instead of having 2000 polls per second + response data being sent to each client, the server is only responsible for pushing data out to the client when it needs to (which in my case would STILL need to be in very short intervals (~50-100ms). Still, this eliminates polling, which helps a lot.
Conclusion
I don't know how to program a PHP server being able to push data out to clients, but I DO know how to integrate PHP with Javascript and XMLHttpRequest messages (AJAX), which is option 1.
Is it my BEST option tho? Can someone provide data to me about whether or not a server can take a beating from all the ajax polling?
[edit]
From thinking about what I just typed up, I realized that the actions will be taken place by the CLIENT first, then updated to the Server, and as SOON (as close to immediate as possible) the server is updated of these changes, it will put them in the database, which the clients will poll to update themselves. This logically means that Comet is NOT what I want in this particular application.
Please provide me with some feedback related to short-time AJAX Polling though.
This post has been edited by BlackPhoenix: 13 August 2009 - 04:28 PM

New Topic/Question
Reply



MultiQuote







|