当前位置:网站首页>MongoDB系列之适用场景和不适用场景
MongoDB系列之适用场景和不适用场景
2022-06-26 12:41:00 【smileNicky】
MongoDB是一款开源的分布式架构的NoSQL数据库管理系统。在前面的NoSQL和SQL对比学习中,我们知道了NoSQL数据库系统和传统的RDBMS的不同和优点
1、MongoDB优点
可以简单列举MongoDB一些明显的主要的优点
- 速度:MongoDB比一般的关系型数据库快很多,作为面向文档的NoSQL数据库,MongoDB可以通过索引使访问文档变得很容易而且快速
- 分片:MongoDB另外一个优势是允许用户存储大量的数据,其通过分片的方式将数据分发到多个服务器上。
- 灵活性:因为MongoDB是非结构化的数据库系统,而且多种数据类型,所以不需要像关系型数据那样,进行特别的表结构设计,存储数据更加灵活
- 分布式:MongoDB数据库默认支持分布式,内带分布式的解决方案
2、MongoDB局限性
- 不支持连接:与支持连接的理性数据库不同,MongoDB 不支持。尽管可以通过手动编码来添加连接功能,但执行起来可能会很慢并影响性能。
- 数据大小有限制:MongoDB允许的文档最大值为16MB
- 不能无限嵌套:MongoDB的数据格式是BSON的,但是其不支持无限的嵌套,用户不能超过100级的文档嵌套
- 高内存:MongoDB会存储每个值对的键名。它还受到数据冗余的影响,因为它缺乏连接的功能。这会导致高内存使用率。
- 不支持业务复杂查询:MySQL这些类型数据库都可以进行表连接等等复杂业务查询,MongoDB是文档型的数据库,所以不支持联表(Collection)查询
3、适用场景
归纳了MongoDB一些比较明显的特征后,我们可以知道MongoDB的一些适用场景。
在MongoDB官网也会列举了MongoDB的适用场景:
- 1)网站实时数据:MongoDB 非常适合实时的插入,更新与查询,并具备网站实时数据存储所需的复制及
高度伸缩性。- 2)数据缓存:由于性能很高,MongoDB 也适合作为信息基础设施的缓存层。在系统重启之后,由 MongoDB
搭建的持久化缓存层可以避免下层的数据源过载。- 3)大尺寸、低价值数据存储:使用传统的关系型数据库存储一些数据时可能会比较昂贵,在此之前,很
多时候程序员往往会选择传统的文件进行存储。- 4)高伸缩性场景:MongoDB 非常适合由数十或数百台服务器组成的数据库。MongoDB 的路线图中已经包
含对 MapReduce 引擎的内置支持。- 5)对象或 JSON 数据存储:MongoDB 的 BSON 数据格式非常适合文档化格式的存储及查询。
4、不适用场景
- 1)高度事务性系统:例如银行或会计这些金融系统。传统的关系型数据库目前还是更适用于需要大量原子性复杂事务的应用程序。
- 2)传统的商业智能应用:针对特定问题的 BI 数据库会对产生高度优化的查询方式。对于此类应用,关系型可能是更合适的选择。
所以,对于需要复杂 SQL 查询的问题。MongoDB是不太适合的,在技术选项上需要根据业务场景和公司实际情况选择合适的数据库,关系型数据库和NoSQL数据库各有优缺点,应该根据实际场景合理选择数据库
5、参考资料
- MongoDB应用场景:https://hevodata.com/learn/mongodb-use-case/
- MongoDB 官网地址:https://www.mongodb.com/
- MongoDB 官方英文文档:https://docs.mongodb.com/manual/
- MongoDB 各平台下载地址:https://www.mongodb.com/download-center#community
边栏推荐
- MySQL数据库常见故障——遗忘数据库密码
- imagecopymerge
- 解中小企业之困,百度智能云打个样
- A collection of common tools for making we media videos
- Do you know the limitations of automated testing?
- Solutions to insufficient display permissions of find and Du -sh
- Vivado error code [drc pdcn-2721] resolution
- [how to connect the network] Chapter 2 (middle): sending a network packet
- Chapter 10 setting up structured logging (2)
- Mysql database explanation (V)
猜你喜欢

To solve the difficulties of small and medium-sized enterprises, Baidu AI Cloud makes an example

Chapter 01_ Installation and use of MySQL under Linux

First pass! Baidu AI Cloud Xiling platform has obtained the authoritative certification of digital human ability evaluation from the Institute of information technology
![8. [STM32] timer (TIM) -- interrupt, PWM, input capture experiment (proficient in timer)](/img/e7/2fd8ec8d5e5473c7f84f3e3bcedca8.png)
8. [STM32] timer (TIM) -- interrupt, PWM, input capture experiment (proficient in timer)

Script - crawl the customized storage path of the cartoon and download it to the local

Stack, LIFO

Here Document免交互及Expect自动化交互

Beifu PLC model selection -- how to see whether the motor is a multi turn absolute value encoder or a single turn absolute value encoder

【Spark】. Explanation of several icons of scala file in idea

Bigint: handles large numbers (integers of any length)
随机推荐
Opencv high speed download
适配器模式(Adapter)
shell脚本详细介绍(四)
偶言佳句,孤芳自赏
Processsing mouse interactive learning
Electron official docs series: Distribution
MySQL讲解(二)
SQL assigns the field value of data table B to a column in data table a
Go structure method
【Spark】. Explanation of several icons of scala file in idea
Design of simple digital circuit traffic light
QT . Establishment and use of pri
享元模式(Flyweight)
[shell] generate strings between specified dates
Electron official docs series: Contributing
Analysis and protection of heart blood dripping vulnerability (cve-2014-0160)
J - Wooden Sticks poj 1065
C - Common Subsequence
Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program
Use the script to crawl the beautiful sentences of the sentence fan website and store them locally (blessed are those who like to excerpt!)