node. JS Knowledge Point Learning

Source: Internet
Author: User

node. JS Knowledge Point Learning

First, the basic concept

Node.js, or Node, is a platform that can be JavaScript run on the server side. It can be said that Node.js pioneered the javascript development of the first module, the early javascript requirements are very simple, basically written in the function, and then the process-oriented formulation, and then slowly introduced the idea of object-oriented development, and then slowly written into the class. Finally, the advent of node. JS is beginning to have the concept of JS Modular development, which makes the bloated js code exempt from a series of development challenges such as naming conflicts.

NodeThe most important feature is the asynchronous I/O and event-driven architecture design. Node.jsis a platform that lets JS run outside the browser. Its initial goal is to implement an event-driven, non-blocking I/O Web server.

Node.jsIt's just a JavaScript running environment (or a set of libraries) that js complements the standard for asynchronous IO, which is the ability to read and write networks and files. A library is nothing more than a tune API or anything except a slightly anti-human event callback, and other back-end languages (PHP, Python) are not much worse.

Node.jsUsing single-threaded mode, each thread completes a function, a process can have multiple threads, and an asynchronous request for all I/O. After each asynchronous I/O request is completed, it is pushed to the event queue, awaiting processing by the program process.

In short, node the core idea is: non-blocking, single-threaded and event-driven. (synchronization corresponds to blocking, asynchronous corresponding non-blocking)

Node.jsthe reasons for ebay's choice can be summed up in the following 4 points:

动态语言:开发效率非常高,并有能力构建复杂系统,如ql.io。性能和I/O负载:Nodejs非常好的解决了IO密集的问题,通过异步IO来实现。连接的内存开销:每个Node.js进程可以支持超过12万活跃的连接,每个连接消耗大约2K的内存。操作性:实现了Nodejs对于内存堆栈的监控系统。

Node.JSArchitecture

What can node. js do? Web development: Express + EJS + mongoose/mysql
express 是轻量灵活的Nodejs Web应用框架,它可以快速地搭建网站。Express框架建立在Nodejs内置的Http模块上,并对Http模块再包装,从而实际Web请求处理的功能。ejs是一个嵌入的Javascript模板引擎,通过编译生成HTML的代码。mongoose 是MongoDB的对象模型工具,通过Mongoose框架,可以进行访问MongoDB的操作。mysql 是连接MySQL数据库的通信API,可以进行访问MySQL的操作。

Typically Node.js , Web development requires 3 frameworks to work with, like SSH in Java.

Web chat Room (IM): Express + Socket.io

socket.ioOne is a NODEJS architecture-based, supported websocket protocol for a software package that communicates at all times. socket.ioprovides a complete package for cross-browser building of real-time applications, socket.io fully javascript implemented.

node. JS Knowledge Point Learning

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.