node. JS Pros and cons (reprint)

Source: Internet
Author: User

Copyright belongs to the author.
Commercial reprint please contact the author for authorization, non-commercial reprint please specify the source.
Fengqiasia
Links: http://www.zhihu.com/question/19653241/answer/15993549
Source: Know

To get this straight, let's talk about bottlenecks in the entire Web application architecture, including traffic, processor speed, and memory speed. The bottleneck is the maximum number of concurrent connections that the server can handle. Node. JS solves this problem by changing the way it connects to the server. Each connection emits an event that runs in a process in the node. JS engine instead of generating a new OS thread for each connection (and allocating some companion memory for it). node. JS does not deadlock because it does not allow locks at all, and it does not directly block I/O calls. node. JS also claims that the server running it can support tens of thousands of concurrent connections.

Node itself runs V8 JavaScript. The V8 JavaScript engine is the underlying JavaScript engine Google uses for its Chrome browser. Google uses V8 to create an ultra-fast interpreter written in C + +, which has another unique feature: You can download the engine and embed it in any application. The V8 JavaScript engine is not limited to running in a single browser. As a result, node. JS actually uses the V8 JavaScript engine written by Google and rebuilds it to be available on the server.

node. JS Benefits:
1, the use of event-driven, asynchronous programming for network services and design. In fact, the anonymous function and the closure feature of JavaScript are well suited for event-driven, asynchronous programming. And JavaScript is easy to learn, and many front-end designers can quickly get started with back-end design.
2. Node. js non-blocking mode IO processing gives node. js the high performance and superior load capacity that is consumed by relatively low system resources, and is ideally suited as a middle-tier service dependent on other IO resources. 3. Node. js is lightweight and efficient, and can be considered as the perfect solution for real-time application systems in data-intensive distributed deployment environments. node is ideal for scenarios where you anticipate a high level of traffic before responding to the client, but not necessarily a lot of the server-side logic and processing required.

node. JS Disadvantages:
1. Low Reliability
2, single process, single-threaded, only support single-core CPU, can not fully utilize multi-core CPU server. Once the process has collapsed, the entire Web service is blown away.

node. JS Pros and cons (reprint)

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.