Node ~ Features & Advantages - rohit120582sharma/Documentation GitHub Wiki
Major advantage of Node JS Platform is that it’s modularity. Node programs can be organised in modules. Each and every functionality is divided and implemented as a separate module or package.
A module is a file that exports a scope using module.exports
that may contain (public) functions and shared objects.
Modules are imported through the require()
function. It is similar to import statement in Java Programming language.
Node JS modules are cached once they are loaded into the application for the first time. Multiple calls to load a module may not cause the module code to be executed multiple times.
Node JS has thousands of thousands of modules to develop a wide variety of server-side applications. When we install Node JS Platform, by default it installs only few modules. If our application requires other modules, then we can easily install and configure them at any point of our application development phases.
Node JS supports Non-blocking IO. It uses Asynchronous IO Model to interact with File system or to do Socket communication or network communication.
Asynchronous IO Model means if IO processing is taking more time to read a big file, or make a large query against a database, or wait for any stream of data to fully transmit; then it permits other processing to continue before the transmission has finished.
Node JS does not follow Multi-Thread architecture. It follows Single-Thread with Event Loop architecture to interact or handle requests. It serves any number of requests without any issues.
Node JS does NOT need to handle pooling of requests to a set of threads. That’s why it has less overhead to handle multiple requests concurrently.
Node JS Platform has some built-in API to develop or create HTTP Server, DNS Server, TCP Server etc very easily or quickly.
Node JS Platform provides very good Socket Module API to develop Real-time, Multi-User Chat and Multi-Player Gaming Applications very easily. It supports Unix Socket programming like pipe().
We need to use one and only one language to write whole applications i.e. Java Script. We need to code all layers from UI to Controller to Business Layer to Persistence Layer (From Front-End to Back-End) in Java Script only.
All layers from Front-End to Back-End support same Data Format i.e. JSON (Java Script Object Notation). UI Layer Angular JS Supports JSON Format, Server-Side Scripts written in Express JS supports JSON Format and Back-end MongoDB NO SQL supports same JSON Format.
Node JS Modules are cached once they are loaded into application for first time. Multiple calls to load a module may not cause the module code to be executed multiple times.
We can install only required modules and use them to develop applications. Whenever we need to add new feature or module, we can easily extend it. By following this approach, we can also achieve very light-weight nature into our applications.