何时更换RDBMS / ORM与NoSQL的/文档库 [英] When to replace RDBMS/ORM with NoSQL/DocumentStore

查看:138
本文介绍了何时更换RDBMS / ORM与NoSQL的/文档库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看的MongoDB /标准(但希望有一个通用的面向文档的存储答案)。看来真的好的工作,我很感兴趣,知道什么时候应该使用RDBMS + ORM它呢?

I've looked at MongoDB/norm (but want a general document-oriented store answer). It seems really nice to work with and I'm interested in knowing when it should be used instead of RDBMS+ORM?

我应该使用什么样的,例如:

What should i use for for instance:

  • #1 similiar网站
  • 社会团体
  • 论坛

(我张贴另一个更普遍的<一个href="http://stackoverflow.com/questions/3522069/when-to-replace-rdbms-orm-with-nosql/3522114#3522114">question但它有一个灿烂的答案可能是有趣的人,因此,新的问题)

(I posted another more general question but it got a splendid answer that might be interesting for others, hence the new question)

推荐答案

所有你提到的可以使用的文档存储构建的例子。无论你的的使用,要看具体要求。

All of the examples you mentioned can be built using a document store. Whether you should use it, depends on the exact requirements.

如果你正在处理一个支持的金钱交易一个社会共同体,你真的应该使用RDBMS来处理这些交易。你根本不能有不一致的数据在这个区域。

If you're dealing with a social community that supports money transactions, you really should use an RDBMS to handle these transactions. You simply cannot afford to have inconsistent data in this area.

如果您的应用程序没有在数据一致性方面是非常严格的要求,你可以考虑使用一个数据库文件。它通过一个RDBMS具有几个优点。例如,如果您使用的是领域驱动设计来构建应用程序,你'会发现,总根源可以自然地存储为单个文件。这将导致实体内的非常小的数据碎片,给你当你在多个节点分片数据更好的性能。

If your application doesn't have very stringent requirements in terms of data consistency, you can consider using a document database. It has several advantages over an RDBMS. For example, if you're using domain-driven design to build your application, you'll find that aggregate roots can be naturally stored as a single document. This will result in very little data fragmentation within entities, giving you better performance when you're sharding your data across multiple nodes.

某些驱动程序,包括定额MongoDB的,支持的类型鉴别。这允许你坚持使用很少的配置补湿多个子类。例如,如果您的应用程序支持多种类型的家庭住址,司机将采取的处理不同的地址亚型护理。您还可以添加新的亚型,驱动程序会自动处理这些为好。请参见这篇文章进行了详细的例子。

Some drivers, including NoRM for MongoDB, support type discriminators. These allow you to persist and rehydrate multiple subclasses using very little configuration. For example, if your application supports multiple types of home addresses, the driver will take care of handling the different address subtypes. You can also add new subtypes and the driver will automatically handle these as well. See this article for a detailed example.

以上是不可能没有面向文档存储的最大优势SQL数据库:无模式的数据。如果你正在处理的用户定义的数据,文档数据库是要走的路。例如,如果你允许用户上传文件,并自由地与任何数据,他们希望他们的标签,你可以很容易地存储这些标签为纯键值对,甚至嵌套的键值结构分类的标签。

The above wouldn't be possible without the biggest advantage of document-oriented stores over SQL databases: schema-less data. If you're dealing with user-defined data, document databases are the way to go. For example, if you allow users to upload files and freely tag them with whatever data they want, you can easily store these tags as plain key-value pairs, or even nested key-value structures for categorized tagging.

这篇关于何时更换RDBMS / ORM与NoSQL的/文档库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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