Node.js Process Model



In this section, we will learn about the Node.js process model and understand why we should use Node.js.

Node.js Process Model:

As compared to traditional web server model, which uses dedicated thread programming technique  where each request is handled by a dedicated thread, Node.js requests the users differently by using single-threaded programming, where all the user requests is handled by a single thread. Node.js is an open source server environment which uses asynchronous, non- blocking and single threaded, programming to create networking and server-side applications by running JavaScript applications on the server. Node.js uses asynchronous programming which makes it memory efficient.

In Node.js there is no need to wait for the request to complete by a single thread and continues with the next request. This reduces the waiting time to zero and thus make Node.js Process Model more faster than the traditional web server model. It is a cross-platform, highly scalable, lightweight framework with very less modules. However, Node.js Process Model is not designed for heavy computation and is thus limited for this.

Comparison between Traditional Web Server Model and Node.js Process Model:

 

Traditional Web Server Model Node.js Process Model
 Each user request is handled by a dedicated thread from the thread pool. All the user requests is handled by a single thread.
In case of no thread availability in the thread pool, then in such a situation the user request waits till the next available thread. There is no need to wait for the request to complete by a single thread and thus it is free to handle the next request at that point of time only.
A thread dedicated to a particular user request returns to the thread pool only after completing the whole execution and after returning a response. For each request, the Input/output work is completed asynchronously and on completion of the whole execution process, it sends the response.

 

 

Tags: ,
Leave a comment

Your email address will not be published. Required fields are marked *

Subscribe now

Receive weekly newsletter with educational materials, new courses, most popular posts, popular books and much more!

https://bridgejunks.com/ https://crownmakesense.com/ https://brithaniabookjudges.com/ https://hughesroyality.com/ https://rhythmholic.com/ https://bandar89.simnasfikpunhas.com/ https://www.100calshop.co.il/products/thailand/ https://myasociados.com/ https://solyser.com/ http://konfidence.cz/ https://muscadinepdx.com/ https://bandar89.parajesandinos.com.ve/ https://goremekoop.com/ https://oncoswisscenter.com/ https://www.turunclifehotel.com/bandar89/ https://www.houseofproducts.biz/ https://taimoormphotography.com/
BIJI18 BIJI18 BIJI18