无模式数据库系统的吸引力是什么? [英] What's the attraction of schemaless database systems?

查看:166
本文介绍了无模式数据库系统的吸引力是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经听到很多关于无模式(经常是分布式)的数据库系统,如MongoDB,CouchDB,SimpleDB等等。

I've been hearing a lot of talk about schema-less (often distributed) database systems like MongoDB, CouchDB, SimpleDB, etc...

可以理解他们可能对某些目的有价值,在我的大多数应用程序中,我试图持久化具有特定类型的字段的对象,我只是在关系模型中自动认为。我总是考虑具有唯一整数id,null / not null字段,SQL数据类型和选择查询以找到集合的行。

While I can understand they might be valuable for some purposes, in most of my applications I'm trying to persist objects that have a specific number of fields of a specific type, and I just automatically think in the relational model. I'm always thinking in terms of rows with unique integer ids, null/not null fields, SQL datatypes, and select queries to find sets.

到这些新系统的分布式性质和容易的JSON / RESTful接口,我不明白如何宽松地键入键/值哈希将帮助我与我的发展。为什么一个宽松类型,无模式的系统对于保持干净的数据集是好的?例如,如何查找日期介于x和y之间的所有项目(当他们可能没有日期时)?有没有任何联接的概念?

While I'm attracted to the distributed nature and easy JSON/RESTful interfaces of these new systems, I don't understand how loosely typed key/value hashes will help me with my development. Why would a loose typed, schema-less system be good for keeping clean data sets? How can I for example, find all items with dates between x and y when they might not have dates? Is there any concept of a join?

我理解许多系统有自己的差异和优势,但我想知道范式的差异。我想这是一个开放式的问题,但也许社区的答案和他们亲自看到的这些系统的优点的方式将有助于启发我和其他人,当我想要使用这些(诚然更髋)系统,而不是传统的RDBMS。

I understand many systems have their own differences and strengths, but I'm wondering at the difference in paradigm. I suppose this is an open-ended question, but perhaps the community's answers and ways they have personally seen the advantages of these systems will help enlighten me and others about when I would want to make use of these (admittedly more hip) systems instead of the traditional RDBMS.

推荐答案

我会提出一两个常见原因答案)

I'll just call out one or two common reasons (I'm sure people will be writing essay answers)


  1. 对于高度分布式系统,任何给定的数据集可能分布在多个服务器上。当这种情况发生时,DB引擎可以保证的关系约束大大减少。您的参照完整性的一些需要在应用程序代码中处理。这样做时,您会快速发现几个问题:

  1. With highly distributed systems, any given data set may be spread across multiple servers. When that happens, the relational constraints which the DB engine can guarantee are greatly reduced. Some of your referential integrity will need to be handled in application code. When doing so, you will quickly discover several pain points:


  • 您的逻辑分布在多个图层
  • 您的逻辑分布在多种语言(SQL和您选择的应用程式语言)

结果是逻辑更少封装,更少便携,更换更昂贵。许多开发人员发现自己在应用代码中编写更多的逻辑,而在数据库中更少。极端地,数据库模式变得不相关。

The outcome is that the logic is less encapsulated, less portable, and MUCH more expensive to change. Many devs find themselves writing more logic in app code and less in the database. Taken to the extreme, the database schema becomes irrelevant.

架构管理(尤其是在停机时间不是可选项的系统上)很难。减少模式复杂性降低了这种困难。

Schema management—especially on systems where downtime is not an option—is difficult. reducing the schema complexity reduces that difficulty.

ACID在分布式系统上不能很好地工作( BASE CAP < a>等)。 SQL语言(以及在一定程度上的整个关系模型)针对事务ACID世界进行了优化。所以一些SQL语言特性和最佳实践是无用的,而其他的实际上是有害的。一些开发人员对反对谷物感到不舒服,并倾向于完全舍弃SQL语言,因为他们的需求是从根本上设计的。

ACID doesn't work very well for distributed systems (BASE, CAP, etc). The SQL language (and the entire relational model to a certain extent) is optimized for a transactional ACID world. So some of the SQL language features and best practices are useless while others are actually harmful. Some developers feel uncomfortable about "against the grain" and prefer to drop SQL entirely in favor of a language which was designed from the ground up for their requirements.

成本:大多数RDBMS系统不是免费的。扩展的领导者(Oracle,Sybase,SQL Server)都是商业产品。当处理大型(Web Scale)系统时,数据库授权成本可以达到或超过硬件成本!成本足够高,可以在OSS产品(所有重要的NOSQL产品都是OSS)上构建自定义解决方案,从而大幅改变正常的构建/购买注意事项。

Cost: most RDBMS systems aren't free. The leaders in scaling (Oracle, Sybase, SQL Server) are all commercial products. When dealing with large ("web scale") systems, database licensing costs can meet or exceed the hardware costs! The costs are high enough to change the normal build/buy considerations drastically towards building a custom solution on top of an OSS offering (all the significant NOSQL offerings are OSS)

这篇关于无模式数据库系统的吸引力是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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