What is node js ?
How to decide when to use Node.JS and why?
- Node.js is well suited for applications that have a lot of concurrent connections and each request only needs very few CPU cycles, because the event loop (with all the other clients) is blocked during execution of a function.
- If server side application code requires very less cpu cycle. In other world application are doing non blocking operation and does not have heavy algorithm or Job which consumes lots of CPU cycle. then you can use Node Js.
- If you are Java Script programmer and comfortable in writing Single Threaded code just like client side JS.
When NOT to use Node.JS
- If server side application includes blocking oprations like File IO or Socket IO.
- If server side application is dependent on heavy CPU consuming algorithm/Job.
- If server side application request is dependent on third party WebService Call.
Scalability with Node.JS
Currently, Node.JS itself does not utilize all core of system and it is single threaded by default, you have to write program logic by your own to utilize multi core processor and make it multi threaded.
Note: nodejs is great for making real time systems like analytics, chat-apps, apis, ad servers, etc.