What is Node js

https://www.monterail.com/blog/nodejs-development-enterprises

https://medium.com/@abshirj05/what-does-event-driven-and-non-blocking-i-o-mean-57ac4f54288e


Event driven means when you make a call, your node server catches the request and registers a function. Let me repeat, Nodejs registers a function instead of the actual data. Why though? Here is why. Instead of having the event-cycle to wait for the data while it’s fetching (which could take sometime), node simply registers an event that will be called when the fetching is done and frees the event-cycle to take the next request.

 

How node js works?

https://www.youtube.com/watch?v=YSyFSnisip0&t=463s

 Note-: use node js for i/o intensive not for CPU intensive .

node js uses non blocking i/o and event loop  .

event loop makes node js asynchronous .

node js libuv which is written in c++ and c++ uses system kernel so behind the scene multithreading is done.

 

single thread accept request and pass to the event loop and takes next request and uses asynchronous to complete the work.


event loop

https://www.youtube.com/watch?v=8zKuNo4ay8E





 

 

 

 

 

 

 

 

 






Comments

Popular posts from this blog

event loop and callback queue ,call stack