Introduction to NodeJS and Its Request Processing Model


           In this article, we will see the basic introduction of NodeJS and Its request processing model. NodeJS is a server-side Javascript run time built on top of Chrome’s V8 engine. Node run time is an event-driven, asynchronous and nonblocking I/O, that provides a lightweight environment. As opposed to traditional web servers, NodeJs uses single thread event loop to process the requests.

Now let us understand how NodeJS process the requests by following the below diagram.

NodeJS Request Processing

             From the above diagram, all the requests which are going to NodeJS server will be maintained in “Event Queue“. The “Event Queue” will be processed by “Event Loop” which will run with a single thread. The “Event Loop” will take requests from the “Event Queue” and the response will be given back to the client. The “Event Loop” will run infinitely to complete the requests available in the queue. If there are no requests in the queue, the event loop will be an ideal state. For example, the request R1 is a nonblocking I/O request, then the event loop will return the response immediately to the client. In the above diagram request R2 is expecting information from external systems like database/file system, then the event loop will leave that request to the “Node Internal Thread Pool”.  A thread from the thread pool will take the request R2 to process. Whenever the request R2 is ready with the data, then the thread handover the request R2 to the event loop. Then the event loop will send the response back to the respective client. This is how NodeJS server handles multiple requests with “Single Threaded Event Loop“.

             In the coming articles, we will see the NodeJS running environment with examples. Till then, Happy Learning!!!


I am Siva Prasad Rao Janapati. Working as a software developer. Has hands on experience on ATG Commerce(DAS/DPS/DCS), Mozu commerce, Broadleaf Commerce, Java, JEE, Spring, Play, JPA, Hibernate, Velocity, JMS, Jboss, Weblogic,Tomcat, Jetty, Apache, Apache Solr, Spring Batch, JQuery, NodeJS, SOAP, REST, MySQL, Oracle, Mongo DB, Memcached, HazelCast, Git, SVN, CVS, Ant, Maven, Gradle, Amazon Web services, Rackspace, Quartz, JMeter, Junit, Open NLP, Facebook Graph,Twitter4J, YouTube Gdata, Bazzarvoice,Yotpo, 4-Tell, Alatest, Shopzilla, Linkshare. I have hands on experience on open sources and commercial technologies.

Tagged with: , , ,
Posted in Node.js

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s



Java Code Geeks
Java Code Geeks
%d bloggers like this: