文件存储的最佳用途是什么? [英] What are the best uses of document stores?

查看:147
本文介绍了文件存储的最佳用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经听到很多关于面向文档的数据存储像CouchDB。我理解BigTable像Cassandra这样的商店的用法。阅读此问题后,我想知道条件是什么

I have been hearing a lot about document oriented data stores like CouchDB. I understand the uses of BigTable like stores such as Cassandra. After reading this question, I was wondering what the conditions would be to merit using a document store?

推荐答案

诸如Bigtable和Cassandra之类的列家族存储具有非常有限的查询功能。应用程序负责维护索引以查询更复杂的数据模型。

Column-family stores such as Bigtable and Cassandra have very limited querying capabilities. The application is responsible for maintaining indexes in order to query a more complex data model.

文档数据库允许您查询内容,而不仅仅是密钥。它还将管理您的索引,降低应用程序的复杂性。

Document databases allow you to query the content, not just the key. It will also manage the indexes for you, reducing the complexity of your application.

域驱动设计传播聚合和值对象的使用。 如Ayende指出,(复杂)聚合是非常自然的候选,​​以存储为单个文档,而不是在多个表或列族上进行归一化。这将减少持久层的复杂性。

Domain-driven design evangelizes the use of aggregates and value objects. As Ayende points out, (complex) aggregates are very natural candidates to be stored as a single document, instead of normalizing them over multiple tables or column families. This will reduce the complexity of your persistence layer. There's also less chance that related data is scattered across multiple nodes, as all the data is contained in a single document.

如果您的应用程序需要存储多态对象,文档数据库也是一个很好的候选人。当然,这也可以存储在Cassandra,但你不会有同样多的查询功能。至少不是开箱即用。

If your application needs to store polymorphic objects, document databases are also a good candidate. Of course, this could also be stored in Cassandra, but you won't have as much querying capabilities. At least not out of the box.

将文档数据库视为豪华跑车。它不需要一个专业的驱动程序(阅读:复杂的应用程序),让你从A到B,它具有空调和舒适的座位等功能,它将在可接受的时间搭配高可扩展性轨道。但是,如果您想在高扩展性轨道上设置一个圈记录,您将需要一个专业的驱动程序和一个高度优化的汽车(例如Cassandra),它缺少空调等功能。

Think of a document database as a luxurious sports car. It doesn't need a professional driver (read: complex application) to get you from A to B, it has features such as air conditioning and comfortable seats and it will lap the high-scalability track in an acceptable time. However, if you want to set a lap record on the high-scalability track, you will need a professional driver and a highly optimized car (e.g. Cassandra), which lacks features such as air conditioning.

这篇关于文件存储的最佳用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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