The Node.js architecture uses an event-driven, non-blocking I/O model, which allows for fast handling of concurrent operations via its event loop and single-threaded runtime environment.
These are written in JavaScript and are immediately accessible to the outside world, allowing users to interact with Node.js internal components.
Node.js Binding is a Core API that links JavaScript to C/C++ libraries.
You may create Node.js Add-ons in C/C++ to operate with Node.js.
V8 is Google's open-source JavaScript engine, written in C++. It is a JavaScript virtual machine (VM) that compiles JavaScript code into native machine code rather than interpretation. It is the quickest JIT (Just-In-Time) compiler for JavaScript.
Libuv is a multi-platform C++ library that handles Node.js thread pools, event loops, and async I/O operations. In Node.js, blocking I/O operations are delegated to LibUV modules, which use a fixed-size C++ thread pool to handle them. When these operations are complete, they are reported to the Event loop.
C-ares is a C library that can handle async DNS requests, name resolutions, and multiple DNS searches in parallel.
This is a C library that parses HTTP requests and responses.
OpenSSL is a C library that implements Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols. It also includes all of the necessary cryptographic procedures such as hashing, ciphering, deciphering, signing, and verifying.
Zlib is a C library that handles data compression and decompression.
Incoming requests might be either blocking (complicated) or non-blocking (simple) based on the actions that a user wants to accomplish in a web application.
The Node.js server is a server-side platform that accepts user requests, processes those requests, and returns results to the users.
The Event Queue in a Node.js server stores incoming client requests and passes them one by one into the Event Loop. The event loop contains six phases, which are:
The thread pool comprises all the threads available for carrying out some tasks that may be necessary to fulfill client requests.
The Event Loop receives and processes requests indefinitely before returning responses to the relevant clients.
To deal with blocked client requests, additional resources are required. These resources may be used for processing, data storage, or other purposes.