I need to create a chat similar to facebook chat.
I am thinking to use ajax polling ( to send request every 2-3 seconds ).
Is this a good approach ? Or I need to use other server side languages like erlang and server-comet ?
I need to create a chat similar to facebook chat.
I am thinking to use ajax polling ( to send request every 2-3 seconds ).
Is this a good approach ? Or I need to use other server side languages like erlang and server-comet ?
Or I need to use other server side languages
No - that's not really relevant - the biggest problem is that HTTP does not support push notifications - so the language you use on the web server is pretty much irrelevant.
server-comet ?
Comet is programming technique - not a language - specifically designed to address the absence of push in HTTP. Conventionally, a browser sends a request, the webserver creates a response then sends it back to the client. With Comet, the webserver waits until either:
1) there is some update to include in the response
2) a timer expires
Before sending the response. A consequence of this is that it results in a high number if inactive connections to the webserver - which can cause performance issues.
An alternative approach is to use HTTP to delver a client program to run in the browser which the connects to the chat server using a different protocol. Its possible to do this with ActiveX, Java or flash - all of which have major drawbacks - not least portability.
There are several pre-written solutions out there using PHP and javascript - hint - if the docs don't mention Naggle then they've probably not thought about scalability/performance.
C.