当前位置:网站首页>MongoDB系列之SQL和NoSQL的区别
MongoDB系列之SQL和NoSQL的区别
2022-06-13 06:34:00 【smileNicky】
在选择数据存储时,经常会选择关系型数据库(SQL)和非关系型数据库(NoSQL)进行数据存储,这两种数据各有优缺点,下面进行简单对比
关系型数据库对比非关系型数据库
主要区别:
定义
SQL数据库称之为关系型数据库(RDBMS);而NoSQL数据库被称之为非关系型数据库或者分布式数据库分布式
SQL要支持分布式需要借助于一些第三方组件,比如mycat等实现分布式,而NoSQL数据库默认支持分布式,内带分布式的解决方案结构
SQL是基于表存储数据的,所以SQL是一门结构化的查询语言,修改表结构都可能会影响系统数据存储。而NoSQL数据库是键值对、基于文档、图形数据库或宽列存储等等方式,所以NoSQL 数据库具有用于非结构化数据的动态模式。查询
SQL是可以进行多表联合查询的,所以SQL可以处理复杂的业务,进行复杂的多表关联查询;NoSQL存储结构不固定,可以是key/value的键值,也可以是面向文档的、面向列的、基于图形的。所以SQL更适合于成为需要多行事务的应用程序事务
SQL遵循严格的事务一致性,也即ACID属性(原子性、一致性、隔离性和持久性),而 NoSQL 数据库遵循 分布式的CAP 定理(一致性、可用性和分区容错性)。拓展
有时候要提供SQL数据库的性能,可以通过加CPU 或 SSD 等内容来增加单个服务器的负载。而NoSQL可以通过可以通过分片或在 NoSQL 数据库中添加更多服务器
| 关系型数据库 | NoSQL数据库 |
|---|---|
| 关系型数据库管理系统RDBMS | 非关系型分布式数据库系统 |
| 不支持分布式 | 默认支持分布式,内置分布式解决方案 |
| 结构化查询语言 | NoSQL 数据库具有用于非结构化数据的动态模式 |
| 适合复杂关联查询 | 不适合复杂关联查询 |
| 遵循ACID属性 | 遵循CAP()遵循 CAP(一致性、可用性、分区容错性) |
| 可以通过加CPU 或 SSD 等内容来增加单个服务器的负载 | 可以通过分片或在 NoSQL 数据库中添加更多服务器 |
| 示例: MySQL、PostgreSQL、Oracle、SQL Server 等 | 示例: MongoDB、GraphQL、HBase、Neo4j、Cassandra 等 |
图例来自:https://www.pdai.tech/md/db/nosql-mongo/mongo-x-basic.html
边栏推荐
- Scrcpy source code walk 3 what happened between socket and screen refresh
- [FAQs for novices on the road] understand program design step by step
- Socket programming server and client (multiple clients can connect to the same port of a server at the same time)
- 上位机开发(固件下载软件之架构设计)
- Cocos creator obtains user authorization interface and encapsulates createuserinfobutton
- Introduction to applet layout
- C # mapping from entity class to database (SQLite)
- ADB shell content command debug database
- 105. 从前序与中序遍历序列构造二叉树
- 1154. 一年中的第几天
猜你喜欢

Kotlin basic definition class, initialization and inheritance

In the era of membership based social e-commerce, how do businesses build their own private domain traffic pool?

Failed to extract manifest from apk: processexception:%1 is not a valid Win32 Application.

Notes on wechat applet development

What is online blind box e-commerce? Can blind box e-commerce become a new bonus market for the Internet?

JetPack - - -WorkManger

无刷直流电机矢量控制(四):基于滑模观测器的无传感器控制

MFS details (vii) - - MFS client and Web Monitoring installation configuration

上位机开发(固件下载软件之详细设计)

机器学习笔记 - 监督学习备忘清单
随机推荐
十六、IO流(二)
Glide usage notes
景联文科技:数据采集标注行业现状及解决方案
1154. day of the year
Thread pool learning
【虚拟机】 VMware虚拟机占用空间过大解决
如何使用望友DFM软件进行冷板分析
MFS explanation (V) -- MFS metadata log server installation and configuration
What is the essence of social e-commerce disruption? How can businesses get more traffic?
Outil de formatage du temps - mode. JS (affichage en temps réel du temps Web)
Kotlin collaboration process +flow download case
Ijkplayer compilation process record
Comprehensive overview of ijkplayer contour features for ijkplayer code walk through
If the key in redis data is in Chinese
Kotlin data flow - flow
Socket programming server and client (multiple clients can connect to the same port of a server at the same time)
105. 从前序与中序遍历序列构造二叉树
Logcat -b events and eventlogtags print the location correspondence of the events log in the code
Two uses of bottomsheetbehavior
Construction and verification of Alibaba cloud server webrtc system