Why Node JS?

Because of the rising popularity of Java script, it has brought a very improved newer face to the web development nowadays with lot of changes.

Node js is a free, open source, server-side cross-platform runtime environment created with the aim of creating real time websites with push capabilities. It is used to run scripts on the server to render content before it’s been delivered to the web browser.

Node .js event loop

Node.js uses asynchronous programming.

Node.js handles a file request by sending the request to the file system first. It makes it ready to handle the next request then. When the file system has opened and read the content, it is now ready to deliver the content to the client.

This simply means that node.js does not wait and it simply process the next request.

Pros of node.js

Since node.js has been built on Google chrome’s v8 javascript engine, it is very fast.

Node.js is single threaded.

Easily scalable both horizontally and vertically.

support for common tools like unit testing.

Uses its npm (node package manager) which contains large number of reusable modules.

can generate dynamic web content.

Cons of Node.js

Asynchronous programming model is complex compared to synchronous model.

Any CPU serious calculation will block node.js responsiveness, so a threaded platform is a better approach.

The actual number of robust libraries in node.js are comparatively low.

Concepts of Node.js

Usecases of Node.js

  • I/O bound Applications
  • Data Streaming Applications
  • Data Intensive Real-time Applications (DIRT)
  • JSON APIs based Applications
  • Single Page Applications

Node.js should not be used in high intensive CPU applications!

--

--