开发者

Can MongoDB compress or mark a word that shows up frequently (such as "shopping") as s1 to save space?

Say if the app is like Digg, where users post a web link and add tags. Then there will be many tags that says "shopping", repeatedly in the value part of the key/value pair.

Will MongoDB automatically or be configured so that it will remember that word as "s1" so as to reduce the size of the databas开发者_如何学JAVAe? What if it is the key part that repeat a lot instead (almost always repeat if each "document" has the same property names.)


No, it will not do that, but you can easily do that yourself.

One reason for not wanting to do this at the server is that (according to the mailing list) it makes sharding more difficult.

One reason to want to do this (or other techniques such as compressing the document on disk) is that the space savings also make for smaller memory usage of cached objects and indexes, meaning that you could get better cache hit rates for the same amount of RAM.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜