![](https://static.wixstatic.com/media/9a3369_49a4f88bf1694148b343280f4312a2b5~mv2.jpeg/v1/fill/w_980,h_302,al_c,q_80,usm_0.66_1.00_0.01,enc_avif,quality_auto/9a3369_49a4f88bf1694148b343280f4312a2b5~mv2.jpeg)
Almost 2 decades back, we used to write simple C programs that start from a point, run on a single thread, and terminates at the end. With the advent of programming languages like PHP, Java, .NET we totally got carried away and biased with the way these programming languages work, the idea was to abstract the programmer as much as possible from low-level tasks like networking, IO, multitasking, and multithreading.
Now after so many years, what was the need to reinvent the wheel, go back to some basics, patch a couple of missing stuff, and start all over again?
The answer is simple and is actually easy to explain to a new bee or a naive programmer. However it's much difficult to digest for someone working in the industry for years, obviously due to traditional bias and shock to some design fundas learned in so many years, it's like asking him to drive a bicycle on busy lanes.
Node.js is a server-side platform built on Google Chrome V8 Engine and is developed by Ryan Dahl in 2009. It runs on a single thread and uses event loops and callbacks to support concurrency. So in simple terms, we can use the simplicity of a C program with advanced features like concurrency management of any other programming language. However, the way code is written is different from other programming languages. A programmer just has to make sure that he writes non-blocking code and Node.js will do the rest.
A conventional web server like Apache or IIS creates 1 thread per user request and the entire request execution goes on that thread, you can simply calculate the memory consumption of your user per thread, it is directly promotional to the number of users on your server. Node.js does not create a new thread for a new user request, however, it uses the same parent thread to send a response back to the user. Therefore Node.js servers are highly scalable and blazingly fast if used correctly. Node.js servers can be a disaster if not implemented properly, a single line of blocking code will block all users on your web server.
From an enterprise point of view, Node.js provides the following clear cut benefits which can not be ignored
Fast Development Cycle
Increased Productivity
Blazing Performance
Cost Savings
Long term support
Platform Independent
Node.js can not be used anywhere and everywhere, following are some of the areas where Node.js can be used
Web Servers (Web APIs)
I/O bound applications
Data-intensive real-time applications
Scheduled Jobs
Node.js should not be used in CPU-intensive applications where a lot of complex calculations are involved which may block operations.
Some of the Enterprise using Node.js (partial list)
Dow Jones
Uber
Godaddy
PayPal
Wallmart
NetFlix
Linkedin
New York Times
Comments