Quantcast
Channel: Everyday I'm coding » serverside-javascript
Viewing all articles
Browse latest Browse all 3

Why and When to use node js? [duplicate]

$
0
0

Possible Duplicate:
How to decide when to use NodeJS?

Sorry if i’m a bit ambiguous, but i’m trying to understand the real advantages of using node.js instead of other server-side language.
I’m a javascript enthusiast, so I’m probably going to play with node.js, but I want to know if I should use it in my projects.
Thanks in advance!


Solution:

It’s evented asynchronous non-blocking IO build ontop of V8.

So we have all the performance gain of V8 which is the Google JavaScript interpreter. Since the JavaScript performance race hasn’t ended yet you can expect Google to constantly update performance on V8 (for free).

We have non blocking IO which is simply the correct way to do IO. This is based on an event loop and using asynchronous callbacks for your IO.

It gives you useful tools like creating a HTTP server, creating a TCP server, handling file IO.

It’s a low level highly performant platform for doing any kind of IO without having to write the entire thing in C from scratch. And it scales very well due to the non-blocking IO.

So you want to use Node if you want to write highly scaling and efficient applications using non-blocking IO whilst still having a high level scripting language available. If needed you can hand optimise parts of your code by writing extensions in C.

There are plenty of OS libraries for node that will give you abstractions like express and now

You don’t want to use node if you want (slow) high level abstractions to do everything for you. You don’t want to use node if you want RAD. You don’t want to use node if you can’t afford to trust a young platform, either due to having to write large pieces of code yourself to do things that are build into other frameworks or because you can’t use node because the API isn’t stable yet or it’s a sub 1.0 release.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images