How does the single threaded behaviour of nodejs help in real time chat, wont it create delays for serving different users, if the request are queued up? Also How does Node compare to Erlang?
The single-threaded event-driven system is fast even when handling lots of requests at once, and also simple. Since it is single threaded there are no latencies in creating new threads as in on other languages. Creating new thread for every request is very expensive both in terms of time and space. With node.js it is possible to use long polls elegantly, thus giving an edge over ROR or python. When using node for chat application, since there is no need to create new threads and also the long polls makes it an effective choice, which are primary concerns for a chat application. When comparing Erlang to Node.js, Erlang has really fine-tuned concurrency & network-transparent parallel distributed system. But the learning curve it step comparing to javascript.