The definition of Node.js as supplied by its official documentation is as follows –
Features of Node.js
Following are some of the important features that make Node.js the first choice of software architects.
• Asynchronous and Event Driven: All APIs of Node.js library are asynchronous that is, non-blocking. It essentially means a Node.js based server never waits for an API to return data. The server moves to the next API after calling it and a notification mechanism of Events of Node.js helps the server to get a response from the previous API call.
Let’s elaborate a bit more on this point.
Event-based: a server will constantly be getting requests (at different urls, on different ports) that need to be responded to in different ways when those events take place
Asynchronous: in dealing with a request, a server will need to load other data (from a file, a database, another server like Twitter), and you don’t want your entire server to just lock up while it waits for that external service (we call this I/O for “Input/Output”) to finish. For a typical web request, the majority of time will be spent waiting on I/O.
The synchronous code runs on top of an asynchronous web server (Apache, Rack, WSGI) that creates a synchronous ”thread” to run your Ruby/Python/PHP code. If another request comes in while that first thread is still processing, the web server creates a new thread. Unfortunately, those threads are resource-intensive which means you can only create a limited number of them (based on how powerful your server is). If all your threads are in-use, a new request will have to wait until a previous request is finished and the thread becomes available again.
• Single Threaded but Highly Scalable: Node.js uses a single threaded model with event looping. Event mechanism helps the server to respond in a non-blocking way and makes the server highly scalable as opposed to traditional servers which create limited threads to handle requests. Node.js uses a single threaded program and the same program can provide service to a much larger number of requests than traditional servers like Apache HTTP Server.
• No Buffering: Node.js applications never buffer any data. These applications simply output the data in chunks.
• License: Node.js is released under the MIT license.
The following diagram depicts some important parts of Node.js
Where to Use Node.js
Following are the areas where Node.js is proving itself as a perfect technology partner.
• I/O bound Applications
• Data Streaming Applications
• Data Intensive Real time Applications (DIRT)
• JSON APIs based Applications
• Single Page Applications
Where Not to Use Node.js
It is not advisable to use Node.js for CPU intensive applications.
he next most logical question is, who uses Node.js ? Well to name a few it is being used by eBay, General Electric, GoDaddy, Microsoft, PayPal, Uber, Wikipins, Yahoo! and Yammer. To get a comprehensive list of node.js users CLICK HERE