What are the advantages of Node JS??!!

Node Js
Abolfazl Mohammadijoo

Abolfazl Mohammadijoo

I am a freelance "Full-Stack Developer" and "Full-Stack Engineer". I have Bachelor and Master Degrees in Mechanical Engineering (Control & Robotics) from best Universities in Iran, and have a great knowledge in Artificial Intelligence, Computer engineering and Electrical Engineering.

Node JS is one the highly efficient backend frameworks for web development, written in JavaScript. It was introduced in 2009 for first time by Ryan Dahl. By introducing of the node JS, both of frontend and backend of web could be done only by JavaScript and since then the market had shown vast need for MEAN Stack and MERN Stack developers. MEAN stack is abbreviation of four technologies used for web development: MongoDB, Express JS, Angular JS and Node JS and also MERN stack just replaced the Angular JS with React JS. But the question is, why the reason for the increasing popularity and use of Node JS and what are its advantages than other backend frameworks.

As we know, JavaScript like Python and PHP, is a single threaded language and does not support multi-threading as C++ and Java does. It means every http request in PHP for example, should be done one after other and when the traffics and users on website are a lot, the speed of website and UX will decrease significantly.

As we all know, formerly, before introducing Node JS, the only way of running JavaScript codes, was by browsers and each browser had its own compiler for JavaScript. In 2008, google company made the JavaScript Compiler of google chrome (V8 engine) open source. Ryan Dahl took advantage of this and created Node JS to run JavaScript codes, outside of browsers, but Node JS is much more than this capability. Ryan Dahl combined the V8 engine with a famous library, libuv, which is written with C language and provides support for asynchronous I/O based on event loops, to handle multiple http requests asynchronously and increase the speed of server in times of high traffics.

As we know, multi-threading is not very easy to work with and there are many challenges like “Dead Lock” when call stacks of threads are full and functions in call stack of each thread need the return of each other and that is maybe why some languages like PHP and JavaScript designed single threaded at first step. To fix this problem, node designed with a thread pool (usually 4 thread) and at a time, only one request could be in call stack of each thread and this solves the problems like dead lock and also increases the speed of process as well.

In summary we can emphasis that it could be the main reason behind the speed of Node JS, but we should consider that some backend technologies like Django which is python based, made some modifications to work as a multi-threaded framework and increase the speed of http request handling.

share this post on your social media

2 Responses

  1. J. Carpenter announced in his blog that Flugsvamp 4.0 and other dark web marketplaces have to regularly change their onion addresses to counteract DDoS attacks and evade being blacklisted by services and antiviruses.

Leave a Reply

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

Subscribe to our Newsletter