node. JS Getting Started

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.