What is NodeJS?

Mohomed Irshad
3 min readMay 14, 2022

Node.js is a server-side and networking runtime environment that is open source and cross-platform. NodeJS is lightweight and efficient because it employs an event-driven, non-blocking I/O architecture. It’s perfect for real-time data-intensive applications that operate across several devices. It includes a number of JavaScript libraries to assist with basic programming. NodeJS has the largest set of open-source libraries, to install dependencies or libraries, it utilizes ‘npm’.

How NodeJS works,

  • To serve requests, Node.js keeps a small thread pool.
  • When a request is received, Node.js adds it to a queue.
  • The single-threaded “Event loop,” which is the essential component, now enters the picture. This event loop will never stop waiting for requests.
  • The loop takes a request from the queue and determines if it requires a blocking input/output (I/O) action. If not, the request is processed and a response is sent.
  • The event loop assigns a thread from the internal thread pool to process the request if it requires a blocking action. There are just a few internal threads left. The worker group is a collection of auxiliary threads.
  • Once the blocking operation is completed, the event loop records blocked requests and add them to the queue. This is how it keeps its non-blocking properties.

Because Node.js employs fewer threads, it consumes fewer resources/memory, allowing tasks to be completed faster. As a result, single-threaded design is comparable to multi-threaded architecture for our purposes. When dealing with data-intensive jobs, multi-threaded languages such as Java make a lot more sense. However, Node.js is the logical choice for real-time applications.

What are the Features of NodeJS?

  • Easy — Node.js is simple to get started with. It’s a great place to start if you’re new to web programming. Getting started is simple thanks to a wealth of tutorials and a vast community.
  • Scalable — It allows applications to grow in size. Because Node.js is single-threaded, it can handle a large number of simultaneous connections while maintaining good throughput.

Node.js is now even quicker and more efficient thanks to non-blocking thread execution.

  • Scalable — It allows applications to grow in size. Because Node.js is single-threaded, it can handle a large number of simultaneous connections while maintaining good throughput.

Node.js is now even quicker and more efficient thanks to non-blocking thread execution.

  • Strong backend — Node.js is developed in C and C++, making it fast and allowing for networking capability.
  • Cross-platform compatibility — allows you to use Node.js to construct SaaS websites, desktop programs, and even mobile apps.
  • Maintainable — Node.js is a simple choice for programmers because the frontend and backend could both be handled using JavaScript.

Advantages in NodeJS

  • High performance for Real-time applications
  • Easy scalability
  • Cost-effective
  • Reduces loading time using quick caching
  • Helps in building cross-platform applications

Disadvantages of NodeJS

  • Reduces performance for handling heavy computational tasks.
  • NodeJs Asynchronous programming model can make it difficult to maintain code.
  • It can allow many code changes due to unstable API.

We use NodeJS and react in our campus project. It was easy to develop. Each group member had a CRUD operation to develop and when I asked them about their feedback they told me it was smooth to build it. Of course, while developing all of us had to come through errors and issues, but at the same time it was not hard to identify the errors and fix them. I was quite impressed with NodeJs personally.

--

--

Mohomed Irshad

Student at Sri lankan Institute Of Information Technology and working as a trainee at Inexis Consulting