Node.JS…What is it?

pouya javadi
2 min readJun 14, 2021

--

I have recently delved into working with other backend realm and I came across a technology, Node.JS. What I particularly found this technology appealing is that we can literally write backend non-blocking I/O applications using JavaScript. That is pretty amazing!

It streamline building fast data-intensive applications! These applications get and send data through a back end service called an API. The API serves as an interface between different programs so they are able to talk to each other.

Architecture

Browsers provide different objects for us to carry out certain task using JavaScript. With Node, we have objects that allow us to manipulate the file system by creating and deleting folders, query databases directly, and create web servers to serve data. Both Chrome and Node contain the V8 engine, but provide different run time environments that give us access to different objects/tools to leverage different functions.

Every browser has their own Javascript engine that converts javascript into code that a computer can understand. For example, Microsoft Edge uses Chakra, Firefox uses spidermonkey, and chrome uses V8. This explains why JavaScript code can behave differently in other browsers.

Node is “Async”

Asynchronous, non-blocking servers, like ones made in Node, only use one thread to service all requests. This means an instance of Node makes the most out of a single thread. This means the server can serve a lot of request without requiring more server hardware; which is expensive.

When requests arrive at the server, they are serviced one at a time. However, when the code serviced needs to query the DB for example, it sends the callback to a second queue and the main request continues to run; it doesn’t wait. Now when the DB operation completes and returns, the corresponding callback is pulled out of the second queue and queued in a third queue where they are pending execution. When the engine gets a chance to execute something else, it picks up a callback from the third queue and executes it.

Benefits?

One of the benefits of Node, is that a front-end developer that knows JavaScript can be hired on as a full stack developer with higher pay. Teams can build the front-end of an application and the back end of the application using one language. It makes more sense to use Node on the back end because you’ll use JavaScript all the way front to back with same conventions, code style, tools, etc.

Knowing Node makes you more valuable to employers because they are already in the process of implementing JavaScript on the font-end and backend.

That, is a good news and open up lot of great opportunities for developers and companies aiming to build a fast, scalable applications that demand data intensive processes

--

--

pouya javadi
pouya javadi

Written by pouya javadi

Building solutions, solving problems, engaging with others are pillars of learning in life.

No responses yet