主要的面向文档的数据库系统是否在其 JSON 文档中压缩密钥?
我想使用面向文档的数据库存储大量 JSON 文档,所有文档都具有非常相似的架构(尽管不相同)。
一个示例文档:
{
"firstName": "John",
"lastName": "Smith",
"age": 25,
}
是否有任何系统(CouchDB 等)使用压缩(任何类型)来避免一遍又一遍地存储关键字符串(例如“firstName”)?
我的动机是当存在数百万个文档时,特别是当某些重复键比“firstName”长得多时,最小化磁盘上数据库的大小。
感谢您的想法!
W
编辑:经过更多思考,我想我要问的是更通用的压缩系统的特定情况,其中压缩字典(部分?)在一个文件中的多个压缩文档之间共享。文档存储(可能随着时间的推移而建立)。然后,这将处理不仅仅是 JSON 键的压缩。
做起来会很有趣!
I would like to store a large number of JSON documents using a documented-oriented database, all with very similar schema (though not identical).
One example document:
{
"firstName": "John",
"lastName": "Smith",
"age": 25,
}
Do any of the systems (CouchDB etc.) use compression (of any sort) to avoid storing the key strings (e.g. "firstName") over and over again?
My motivation is to minimise the size of the database on disk when there are millions of documents, especially when some of the recurring keys are much longer than e.g. "firstName".
Thanks for your thoughts!
W
Edit: Having thought about this more, what I think I am asking about is a specific case of a more general compression system in which a compression dictionary is (partly?) shared across multiple compressed documents in a document store (and probably built up over time). This would then handle compression of more than just JSON keys.
Would be interesting to do!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只需添加一个“键映射”文档,您可以在其中存储键及其快捷方式...在后端进行映射应该不会那么麻烦...
I would just add a 'key mapping' document where you store the keys and their shortcuts ... doing the mapping in your backend should not be all that much trouble ...