This is a highly scalable system that uses asynchronous event-driven I/O (input/output), rather than threads or separate processes. It is ideal for web applications that are frequently accessed but computationally simple.
How Does Node.Js Works?
If we use a traditional web server, such as Apache, each time a web resource is requested, Apache creates a separate thread or invokes a new process in order to process the request. Even though Apache responds to requests immediately, and cleans up after the request is satisfied, this approach can still tie up a lot of resources. The popular web application is going to have serious performance issues.
Node.js, on the other hand doesn’t create a new thread or process for every request. Instead, it listens for specific events, and when the event occurs, reacts accordingly. The Node.js does not block any other requests while waiting for the functionality to complete, and events are processed on first come, first serve basis, in a relatively incomplete event loop.