Getting To Know About Node.js

HIRUSHA
3 min readMar 19, 2021

--

Node.js

What is Node.js ?

  • An open source server environment
  • Uses JavaScript on the server
  • Runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)

History

  • Ryan Dahl invented Node. js in 2009.
Ryan Dahl

Why Node.js ?

Why Node.js

Because of its single-threaded nature, Node. js is best suited for non-blocking, event-driven servers. It was created with real-time, push-based architectures in mind and is used for traditional web sites and back-end API services.
additionally It uses an event-driven I/O model, which is extremely efficient and allows for the creation of scalable network applications. Node. js is a popular framework for developing real-time applications, the Internet of Things, and microservices, with over a billion downloads.

Event Loop

Despite the fact that JavaScript is single-threaded, the event loop allows Node.js to perform non-blocking I/O operations by offloading operations to the system kernel whenever possible.
Because most modern kernels are multi-threaded, they can handle multiple background operations. When one of these operations is finished, the kernel notifies Node.js so that the appropriate callback can be added to the poll queue and executed later. This will be explained in greater detail later in this topic.

Event Loop

Phases of the Event Loop

Phases of the Event loop
  • Timers: Callbacks scheduled by setTimeout() or setInterval() are executed in this phase.
  • Pending Callbacks: I/O callbacks deferred to the next loop iteration are executed here.
  • Idle, Prepare: Used internally only.
  • Poll: Retrieves new I/O events.
  • Check: It invokes setIntermediate() callbacks.
  • Close Callbacks: It handles some close callbacks

Advantages of Node.js

  • Simple to understand
  • More fast deployment
  • Improved developer efficiency and overall productivity
  • Sharing and reusing code
  • It is simple to share knowledge within a team.
Advantages of Node.js

Disadvantages of Node.js

  • When dealing with Heavy Computing Tasks, performance suffers.
  • Because of the unstable API, there have been significant code changes.
  • Code that is difficult to maintain
  • There is a high demand for experienced NodeJS developers, and there are only a few available.
Disadvantages of Node.js

Global Companies That Use Node.js

  • LinkedIn
  • Netflix
  • Uber
  • PayPal
  • NASA
  • eBay
  • Yahoo
Global Companies That Use Node.js

--

--

HIRUSHA
HIRUSHA

Written by HIRUSHA

3rd Year Software Engineering Undergraduate

No responses yet