mongodb BSON大小 [英] mongodb BSON size

查看:74
本文介绍了mongodb BSON大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关于stackoverflow的文章,其中提到BSON大小上限为4MB或8MB。对于我的应用程序来说,JSON文档几乎不会有几十个千字节甚至更少。如果我的文档大小那么小,mongodb是否适合我的应用程序。我真正想问的是,mongodb是否为每个文档留出4 MB或8 MB的空间,以便提高快速查找的速度。这个问题听起来可能很愚蠢,但是任何人都可以说它是否适合我的应用程序。

There is post on stackoverflow in which it is mentioned that BSON size limit is upto 4MB or 8MB. Well for my application the JSON documents would be hardly few tens of kilobytes or even less. Is mongodb suitable for my application if my document size is so less. What I actually want to ask is, do mongodb set aside 4 MB or 8 MB of space for every document so as to improve quick lookups. Well the question might sound stupid, but can anyone tell is it suitable for my application or not.

推荐答案

不,较小的文档是很好。没有剩余空间可以使文档适合兆字节大小的块。

No, smaller documents are perfectly fine. There is no space left aside to make a document fit into mega-byte-sized chunks.

MongoDB会保留一些填充,以使文档即使在文档增长的情况下也可以进行就地更新,但这并不是很多。除此之外,文档在磁盘上的空间需求就是数据本身的BSON大小。

MongoDB will leave a little bit of padding to allow for documents to allow for in-place updates even when documents grow, but that is not very much. Other than that, the on-disk space requirement for the document is just the BSON size of the data itself.

这篇关于mongodb BSON大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆