5

Possible Duplicate:
What is node.js?
Usages of Node.js - What obstacles is it aiming to provide a ramp for?

What is the correct scenario to use server side javascript? like node.js What kind of problems it solves?

Community
  • 1
  • 1
Tony
  • 10,088
  • 20
  • 85
  • 139

1 Answers1

1
  • Node.js solves the problem of serving many concurrent users from I/O based servers.
  • By I/O I mean that little to none computation is done in the request response cycle from the server part.
  • By concurrent I meany that thousands of users can keep a connection open with the server.
  • Having a persistent connection allows real time communication, the server can push over the opened connection, in a sense this way the server can be thought of as initiating the communication (comet, server push).

All this allows having a large user-base with little server resources and real-time communication (chat etc).

clyfe
  • 23,695
  • 8
  • 85
  • 109
  • I don't quite understand your point. Is this something like long polling? – ZolaKt Dec 22 '11 at 12:13
  • @ZolaKt: yes, node.js works well for long polling – Sergio Tulentsev Dec 22 '11 at 12:16
  • 1
    @SergeiTulentsev: is it used just for long polling, or are there any other significant advantages? If it is only for long polling why not use a COMET approach, why resort to javascript? – ZolaKt Dec 22 '11 at 12:17
  • It is used for all sorts of things. Some people serve HTML with it. Use what you're familiar with, not what some guy on the internet tells you to. :-) – Sergio Tulentsev Dec 22 '11 at 12:19