Getting Started with Node.js (documentation)

Node.js is a platform built on the Chrome JavaScript runtime, which is used to easily build responsive and easily scalable web applications. Node.js uses an event-driven, non-blocking I/O model to be lightweight and efficient, making it ideal for running data-intensive real-time applications on distributed devices.

The V8 engine itself uses some of the latest compilation techniques. This greatly improves the running speed of code written in scripting languages ​​such as Javascript, and saves development costs. The need for performance is a key factor in Node. Javascript is an event-driven language, and Node takes advantage of this to write highly scalable servers. Node employs an architecture called an "event loop" that makes it easy and safe to write highly scalable servers. There are various techniques for improving server performance. Node has chosen an architecture that improves performance while reducing development complexity. This is a very important feature. Concurrent programming is often complex and riddled with mines. Node bypasses these and still provides good performance.

Course link: Getting Started with Node.js (documentation)

Node uses a series of "non-blocking" libraries to support the way the event loop works. In essence, it provides interfaces for resources such as file systems and databases. When sending a request to the file system, there is no need to wait for the hard disk (addressing and retrieving the file), the non-blocking interface will notify Node when the hard disk is ready. This model simplifies access to slow resources in a scalable way that is intuitive and easy to understand. Especially for users who are familiar with DOM events such as onmouseover and onclick, there is a feeling of deja vu.
While having Javascript running on the server side is not unique to Node, it is a powerful feature. We have to admit that the browser environment limits our freedom of choice of programming languages. Any desire to share code between servers and increasingly complex browser client applications can only be achieved through Javascript. While there are other platforms that support Javascript running on the server side, Node has grown rapidly to become the de facto platform because of the above features.
In the short time since Node started, the community has contributed a large number of extension libraries (modules). Many of them are drivers that connect to databases or other software, but many are very useful software made by their strength.

Last but not least is the Node community. Although the Node project is still very young, it is rare to see such a fervent community for a project. Whether it's a novice or an expert, everyone uses and contributes their abilities around the project, and is committed to creating a paradise for exploration, support, sharing, and advice.

Advantages of Node.js

As an emerging front-end framework and back-end language, nodejs has many attractive features:

RESTful API

single thread

Node.js can process tasks concurrently without adding additional threads - Node.js is single-threaded. It implements concurrent operations through event loop (event loop), and we should take full advantage of this - avoid blocking operations as much as possible, and use non-blocking operations instead.

non-blocking IO

V8 virtual machine

event driven

More excellent courses:

7 days to play cloud server

ApsaraDB for Redis Tutorial

Getting Started with Cloud Storage Object Storage OSS

Alibaba Cloud CDN Tutorial

Load Balancing Getting Started and Product Usage Guide

Alibaba Cloud University Official Website (Alibaba Cloud University - Official Website, Innovative Talent Workshop under the Cloud Ecosystem )

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325094301&siteId=291194637