What Nodejs can use to do
? A website with complex logic;
? Large-scale WEB applications based on social networks;
? Web Socket server;
? TCP/UDP socket Application; 8? command-line tools;
? Interactive terminal program;
? A local application with a graphical user interface;
? Unit testing tools;
? Client-side JavaScript compiler
asynchronous I/O and event-driven
The biggest feature of node. JS is the asynchronous I/O and event-driven architecture design. For highly concurrent solutions, the traditional architecture is a multithreaded model that provides a system thread for each business logic to compensate for the time overhead of synchronous I/O calls through system thread switching. node. JS uses a single-threaded model, with asynchronous requests for all I/O, avoiding frequent context switching. node. JS maintains an event queue during execution, the program enters the event loop at execution time, waits for the next event to arrive, and each asynchronous I/O request is pushed to the event queue, waiting for the process to be processed:
Disadvantages:
Because it does not conform to the general linear idea of the developer, it is often necessary to split a complete logic into events, increasing the difficulty of development and commissioning.
Performance of Nodejs
node. JS replaces multi-threading with asynchronous I/O and event-driven, resulting in considerable performance gains. In addition to using V8 as the JavaScript Engine, node. JS also uses efficient Libev and LIBEIO libraries to support event-driven and asynchronous I/O
Architecture diagram for Nodejs:
Nodejs Performance Comparison is a reference to many articles on the Internet
node. JS Getting Started