- Nodejs Consulting
- Angularjs Consulting
- Nodejs Development
A key goal of Node.js is to provide scalable network applications and change the way connections are made to the web server. Node makes the use of Event-Driven programming approach Instead of spawning a new OS thread for each network connection and allocating the required memory for it (just like the way Java, PHP works). Each connection fires an event run within the Node’s engine’s process. Since there are no locks, it doesn’t block for I/O calls hence supporting tens of thousands of concurrent network connections on a same physical box.
Why use Node.js?
Node.js is not a silver bullet that will dominate the web development world, but it fills a particular need. Node.js is highly useful for building applications where a high volume of traffic is expected but at the same time the amount of server-side logic and processing isn’t necessarily large (less heavy computations) before responding to the client. So Node.js is not recommended for CPU intensive operations. One of the examples could be building RESTful API which takes a few parameters, interprets them, and generates a response which is a small to medium amount of text.
Another example would be to use it to build a real time chat application as it is lightweight, high traffic and is data-intensive. Node.js is created to solve I/O scaling problem which it really does it quite well and is never designed to solve scaling problem in regards to computation.