Node Js course – 3 Why should I use Node.js?

Hi, one of the definitions for Node.js is that also is a “non-blocking I/O” and I/O means “Input, Output” and here the Node application is going to use I/O anytime that try to communicate with the outside world, for example: read some data from a file on the file system or if your App needs to communicate with another server that is I/O as well like query some database to get some data and this will be a I/O operations and this operations take time, so with Node.js we get non-blocking I/O that means that our Node application is waiting for a response but can do other things, continue with other process, other code, other requests. 

Non Blocking is actually from the browser, so non-blocking I/O starting in the browser because otherwise the browser will completely freezer up. 

In this next example the non-blocking example is better that the other because the time is less and the user can do other things while some process are running

So that is why Node.js is “non-blocking I/O model that makes it lightweight and efficient”. 

By Cristina Rojas.