本文介绍了MongoDB单文档大小限制为16MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已知信息:知道MongoDB存储在BSON()和为16MB。 p>

问题:为什么16MB本身为什么不是32MB或64MB或更多,并且在什么地方完全限制为16MB,什么是依赖的原因正好16MB?



提到在传输过程中,不会消耗过多的带宽,并且不需要在服务器上使用过多的RAM。但是如果我们能负担得起网络带宽和RAM内存消耗。此外,除了之外,我们还没有任何选项。为什么?



这听起来很蠢。但是,任何人都可以给这个明亮的灯光吗?



更新:现在是4MB,现在是16MB。





我们可以通过发出以下命令来检查Mongo Shell:

  db.isMaster ).maxBsonObjectSize /(1024 * 1024)

为什么不允许?

解决方案

查看JIRA票证上的线程,将值从4MB增加到16MB。对于机票有一个相当大的辩论:



这似乎是任意为什么他们选择16MB,而不是说32MB。它增加了,因为许多人需要存储大于4MB的文档(我认为低于16MB)。有些人要求在线程使它可配置(像你问),这对我有意义。不知道为什么他们没有决定这样做。


Known Information: Its is know that MongoDB stores in BSON (Binary JSON) and the maximum BSON document size is 16MB.

Question: Why 16MB itself why not 32MB or 64MB or still more and where exactly the limit has been put for 16MB and what are the reasons to depend on exactly 16MB?

It is mentioned that during transmission, excessive amount of bandwidth will not be consumed and does not require excessive amount of RAM at server. But What if we can afford the network bandwidth and RAM memory consumption. Then also, we are left with no option other than GridFS. Why?

It may sound stupid. But please could anyone put some bright light on this?


Update: It was 4MB and now 16MB.

mongodb BSON size

We can check it on Mongo Shell by issuing following command

db.isMaster().maxBsonObjectSize/(1024*1024)

Why it is not allowed as configurable by DBAs?

解决方案

Check out the thread on the JIRA ticket that increased the value from 4MB to 16MB. There is a sizeable debate on the ticket: https://jira.mongodb.org/browse/SERVER-431

It seems to be arbitrary why they chose 16MB, and not say 32MB. It was increased because many people needed to store documents larger than 4MB (and I presume lower than 16MB). Some people have asked in that thread to have it made configurable (like you asked), which makes sense to me. Not sure why they haven't decided to do this.

这篇关于MongoDB单文档大小限制为16MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 16:44