Node.js: A Next Gen Technology (Geek to Geek)


Node.js is a tool to run it as a web server to build a client server application
It uses to Google V8 engine to execute JavaScript code
Built upon event driven architecture
By default, the only single thread is responsible for handling the client request, but we can run multiple threads on the same machine to achieve scalability and fault tolerance.
In order to build an application, we need to use a third-party web framework like Express, Meteor, etc.

Application code gets compiled by V8 (JavaScript engine developed by Google to use in Chrome). The code communicates with low-level Node.js components via bindings. All the events written in the code are registered with Node.js. Once events are triggered, they are enqueued in the event queue according to the order that they are triggered. As long as there are events in the event queue, the event loop keeps picking them up, calling their callback functions, and sending them off to worker threads for processing. Once a callback function is executed, its callback is once again sent to the event queue, waiting to be picked up by the event loop again.
Components of Node.js
V8: V8 is Google’s open-source high-performance JavaScript engine, written in C++ and used in Chromium, Node.js, and multiple other embedding applications