

So for our purposes, this single-threaded architecture is equivalent to multi-threaded architecture. Since Node.js uses fewer threads, it utilizes fewer resources/memory, resulting in faster task execution. This is how it maintains its non-blocking nature.

How node.js process incoming requests using the event loop These threads are defined in a thread pool, and each time a request comes in, an individual thread is assigned to handle it. However, multiple threads are used to process concurrent calls. In a multi-threaded request-response model, multiple clients send a request, and the server processes each one before sending the response back. To understand how this is different from other runtimes, we need to understand how multi-threaded concurrent clients are handled in languages like Java. Node.js uses the “Single Threaded Event Loop” architecture to handle multiple clients at the same time. This adds additional use cases to Node.js’s repertoire, such as accessing internal system functionality (like networking).

The runtime uses Chrome V8 internally, which is the JavaScript execution engine, and it’s also written in C++. Wikipedia defines Node.js as “a packaged compilation of Google’s V8 JavaScript engine, the libuv platform abstraction layer, and a core library, which is itself primarily written in JavaScript.” Node.js is written in C, C++, and JavaScript.
