Earlier quoted context omitted.
Global variables are basically instance variables on the process itself. They're going to be shared across all requests in all environments that handle more than a single request per process. If they had different semantics, they wouldn't really be what normal people call "global variables", would they? So you just don't use them and everything's good. Which brings you to the real problem: JavaScript makes it distres…
> Global variables are basically instance variables on the > process itself. Not in JS. See my response to ww520 below.
Seems like jesseedhillon was expecting that Node works like a browser: there's a lot of backend code in another language that handles the HTTP request, and then forks it over to a little JavaScript, and each request gets a new global scope.
It's not like that. There's a teeny bit of C-based backend code; it's the JavaScript part that controls alll the interesting stuff like opening sockets and parsing HTTP headers and the like to determine a request. In a single process, with a single global object, with lots of asynchronous I/O.
Node is JavaScript as a first-class programming language, not subservient to the DOM.