Member-only story

The Top 4 Reasons for Using Node.js

Marika Lam
2 min readJan 21, 2022

--

What is Node.js?

  1. Node.js runs in a single thread with callback concept.
  2. Node is a server which can execute JavaScript. Sort of a server side browser.
  3. Node is a open source, cross platform to make real time network applications.
  4. It provides you asynchronous, event driven I/O APIs.
  5. It runs single threaded event based loop, so all executions become non-blocking.

Node.js runs single-threaded, non-blocking, asynchronous programming, which is very memory efficient.

Pros of Node.js

  1. Non-blocking code — This is the strongest reason to select node as your server. Node is completely event driven and majority of the code runs basing on callbacks. This approach helps the application not to pause or sleep, but to become available for other requests. Let’s explain this with an example
  2. Fast Processing — Node uses V8 JavaScript Runtime engine, the one which Google Chrome uses. Node has a wrapper over this JavaScript engine providing some extra facilities to build network applications. Both the Node wrapper and the V8 JavaScript engine are written using C language; which makes it really fast. It is much faster than Ruby, Python, or Perl.
  3. Concurrent request handling — Node can handle thousands of concurrent connections with a very minimal overhead on a single process.
  4. One environment — Using JavaScript on a web server as well as the browser reduces the impedance mismatch between the two programming environments which can communicate data structures via JSON that work the same on both sides of the equation. Duplicate form validation code can be shared between server and client, etc.

--

--

No responses yet