Introduction to Node.js

Introduction To Node.JS

Written by Sudipta Deb

Published on July 29, 2021

If you’re into web development, you’re are definitely writing codes in JavaScript now. Node is a way to simplify web application development by unifying the server and client side languages.

What is Node.js

Node.js is an open-source, cross-platform, JavaScript runtime environment that executes JavaScript code outside of a web browser.

Node.JS(commonly referred as Node)is built on Google’s V8 JavaScript engine, the same one used for processing in Chrome.

Node.js is based on an event-driven architecture. It is an asynchronous event-driven JavaScript runtime which means it runs code in single thread which accepts the request in queues, process it, and finally replies back when done with success(with results as well) or errors without being blocked or not accepting the newer requests. This behaviour makes Node.js super scalable.

Want to know what we are covering as part of this tutorial series? Click here

Why use Node.js

In today’s world, most of the applications are based on a stateless request-response framework. So in this situation, it is developer’s responsibilities to make sure correct code is placed to ensure the state of web session was maintained. And here comes the main advantage of Node.js. With Node.js, you as a developer can build application that work in real-time and have a 2-way communication. The state is also maintained.

When to use Node.js

Node.js is perfect for below scenarios where it is streaming or event based real-time

  • Communication applications
  • Real-Time Apps
  • Data-Intensive Apps (With proper caution)
  • Scalable Backend solution
  • Non-Blocking Asynchronous Thread
  • Streaming server – Here client requests multimedia to be streamed from different servers.
  • Collaborative environment – Here multiple clients want to work collaboratively on the same content.

When to not use Node.js

For CPU intensive operations, Node.js should not be used. CPU intensive operations like video processing, image processing, machine learning etc. The reason behind is that Node.js has only one thread that handles requests. So if one thread is taking too long to complete the request, then other requests will wait until the previous request is done.

Node.js features

  • Asynchronous event-driven IO helps concurrent request handling – This is the most important feature of Node.js. This feature makes sure that if a request is received by Node for some Input/Output operation, it will execute the operation in the background and continue with processing other requests.
  • Node uses Google Chrome’s V8 JavaScript Runtime engine. Node creates a wrapper on top of V8 engine which makes the processing faster.
  • Node.js uses JavaScript. So development in Node.js is easier if the developer is already familiar with JavaScript programming.
  • Concurrent request handling – Node.js can handle concurrent connections with a very minimal overhead on the single process.
  • Awesome developer community – The community is very active. So getting help from the community is very easy. Also due to the high active community, framework is always up-to-date with the latest web technology.

With that let’s move to the next page where I will talking about “How to install Node.js

You May Also Like…

Basics of Node.Js
Basics of Node.Js

Node.js supports JavaScript. So, JavaScript syntax on Node.js is similar to the browser's JavaScript syntax. Primitive...

How to Install Node.js
How to Install Node.js

Before you start building anything in Node.js, the first thing that you need to do is install Node.js in my machine....

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *