Talking about NoSQL database

database

Database, also known as data management system, is a collection of processed data stored together in a certain way, which can be shared by multiple users and minimize redundancy. In short, it can be regarded as an electronic file Cabinet - a place where electronic files are stored.

Databases include: Oracle database, ACCESS database, SQL database, DB2 database, Sybase, MySQL, MariaDB, VF, SqlServer, SQLite, etc.

Database classification

  • relational database (RDBMS)

Relational databases are built on the basis of relational models, and SQL is the query language for relational databases.

  • Non-relational databases (NoSQL)

Non-relational databases include key-value databases, document databases, search engines, list storage, and graph databases.

  • Key-value database (NoSQL)

Key-value databases store data through the Key-Valye method, and Key and Value can be simple objects or complex objects. Key as a unique identifier. The more popular one is Redis

Advantages : Fast query speed;
Disadvantages : Cannot perform conditions like relational databases. If you want to perform range search, you need to traverse all the keys, which will consume a lot of calculations.

document database

Document-type databases can be used to manage documents. Documents are the basic unit for processing information. A document is equivalent to a record. The more commonly used one is MonogoDB

For more exciting content, please search for " " on WeChat前端爱好者 , and click me to view . '

NoSQL

What is NoSQL

A general term for database management systems that are different from traditional relational databases.

NoSQL databases (meaning "not just SQL") are not in a tabular format and store data differently than relational tables.
The types of NoSQL databases vary by data model.
Primary types include document, key-value, widecolumn, and graph. They provide a flexible schema that scales easily with large amounts of data and high user load.

Classification of NoSQL databases

  • Column store (HBase)
  • Document storage (MongoDB)
  • Key-Value storage (Redis)
  • Graph storage (FlockDB)
  • object storage (db4o)
  • XML storage (BaseX)

Why use NoSQL?

  • Simple (no complex specifications such as atomicity, consistency, isolation, etc.)
  • Easy to scale out
  • Storage for very large-scale data
  • It is very flexible to store data with complex structures (Schema Free)

Daily lesson: 02. What are the global objects in Node.js?

There is a special object in JavaScript called the Global Object (Global Object), which and all its properties can be accessed from anywhere in the program, namely global variables.

In browser JavaScript, usually window is the global object , while the global object in Node.js is global , and all global variables (except global itself) are properties of the global object.

According to the definition of ECMAScript, variables satisfying the following conditions are global variables:

  • Variables defined at the outermost level;
  • properties of the global object;
  • Implicitly defined variables (variables that are not defined for direct assignment).

When you define a global variable, the variable also becomes a property of the global object, and vice versa.

It should be noted that you cannot define variables at the outermost level in Node.js , because all user code belongs to the current module, and the module itself is not the outermost context.

Note: It is best not to use var to define variables to avoid introducing global variables, because global variables will pollute the namespace and increase the risk of code coupling.

Node.js v20.2.0 documentation : https://nodejs.cn/api/

global object

Divide global objects into two categories:

  • real global object
  • module-level global variables

real global object

  • Class:Buffer: Can handle binary and non-Unicode encoded data,
    • Official website address: https://nodejs.cn/api/buffer.html
  • process: The process object provides information about and controls the current Node.js process.
    • Official website address: https://nodejs.cn/api/process.html
  • console: The node:console module provides a simple debugging console, similar to the JavaScript console mechanism provided by web browsers.
    • Official website address: https://nodejs.cn/api/console.html#%E6%8E%A7%E5%88%B6%E5%8F%B0
  • clearInterval, setInterval: set timer and clear timer
  • clearTimeout, setTimeout: set delayer and clear delayer
  • global: the global namespace object, the process, console, setTimeout, etc. mentioned on the wall are all placed in the global.
    • Official website address: https://nodejs.cn/api/globals.html

module-level global variables

These objects are available in all modules. The following variables may appear to be global, but they are not. They only exist in the scope of the module, see the module system documentation (https://nodejs.cn/api/globals.html):

  • __dirname
  • __filename
  • exports
  • module
  • require()

The objects listed here are specific to Node.js.

reference documents

  • https://www.runoob.com/nodejs/nodejs-global-object.html
  • https://nodejs.cn/api/
  • https://vue3js.cn/interview

Guess you like

Origin blog.csdn.net/BradenHan/article/details/130939443