当前位置:网站首页>Differences between SQL and NoSQL of mongodb series

Differences between SQL and NoSQL of mongodb series

2022-06-13 06:45:00 smileNicky

When selecting a data store , Relational databases are often chosen (SQL) And non relational databases (NoSQL) Data storage , These two kinds of data have their own advantages and disadvantages , Here is a simple comparison

Relational databases vs. non relational databases

The main difference :

  1. Definition
    SQL Databases are called relational databases (RDBMS); and NoSQL Databases are called non relational databases or distributed databases

  2. Distributed
    SQL To support distribution, you need to rely on some third-party components , such as mycat Etc , and NoSQL The database supports distributed by default , In band distributed solutions

  3. structure
    SQL It stores data based on tables , therefore SQL Is a structured query language , Modifying the table structure may affect the system data storage . and NoSQL The database is a key value pair 、 Document based 、 Graphic database or wide column storage, etc , therefore NoSQL The database has a dynamic schema for unstructured data .

  4. Inquire about
    SQL You can perform multi table joint queries , therefore SQL Can handle complex business , Perform complex multi table Association queries ;NoSQL The storage structure is not fixed , It can be key/value Key value of , It can also be document oriented 、 Column oriented 、 Graphics based . therefore SQL It is more suitable for applications that need multi line transactions

  5. Business
    SQL Follow strict transaction consistency , That is to say ACID attribute ( Atomicity 、 Uniformity 、 Isolation and persistence ), and NoSQL The database follows A distributed CAP Theorem ( Uniformity 、 Availability and partition fault tolerance ).

  6. expand
    Sometimes SQL Database performance , You can add CPU or SSD And so on to increase the load of a single server . and NoSQL It can be done by slicing or in NoSQL Add more servers to the database

Relational database NoSQL database
Relational database management system RDBMS Non relational distributed database system
Distributed... Is not supported Distributed is supported by default , Built in distributed solutions
Structured query language NoSQL The database has a dynamic schema for unstructured data
Suitable for complex association query It is not suitable for complex association query
follow ACID attribute follow CAP() follow CAP( Uniformity 、 Usability 、 Partition tolerance )
You can add CPU or SSD And so on to increase the load of a single server It can be divided into pieces or in NoSQL Add more servers to the database
Example : MySQL、PostgreSQL、Oracle、SQL Server etc. Example : MongoDB、GraphQL、HBase、Neo4j、Cassandra etc.

Legend from :https://www.pdai.tech/md/db/nosql-mongo/mongo-x-basic.html
 Insert picture description here

原网站

版权声明
本文为[smileNicky]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/164/202206130634136365.html