MongoDB Single Document size limit is 16MB

跟風遠走 提交于 2019-11-26 16:52:14

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/15307800/mongodb-single-document-size-limit-is-16mb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!