简体   繁体   English

CouchDB 的缺点

[英]Disadvantages of CouchDB

I've very recently fallen in love with CouchDB .我最近爱上了CouchDB I'm pretty excited by its enormous benefits and by its beauty.我对它的巨大好处和美丽感到非常兴奋。 Now I want to make sure that I haven't missed any show-stopping disadvantages.现在我想确保我没有错过任何令人瞩目的缺点。

What comes to your mind?你想到了什么? Attached is a list of points that I have collected.附上我收集的点数清单。 Is there anything to add?有什么要补充的吗?

  • Blog posts from as late as 2010 claim "not mature enough" (whatever that's worth).迟至 2010 年的博客文章声称“不够成熟”(无论这值多少钱)。
  • Slower than in-memory DBMS.比内存 DBMS 慢。
  • In-place updates require server-side logic (update handlers) .就地更新需要服务器端逻辑(更新处理程序)
  • Trades disk vs. speed: Databases can become huge compared to other DBMS (compaction functionality exists, though).交换磁盘与速度:与其他 DBMS 相比,数据库可能变得巨大(尽管存在压缩功能)。
  • "Only" eventual consistency. “仅”最终一致性。
  • Temporary views on large datasets are very slow.大型数据集的临时视图非常慢。
  • Replication of large databases may fail .大型数据库的复制可能会失败
  • Map/reduce paradigm requires rethinking (only for completeness). Map/Reduce 范式需要重新思考(仅出于完整性考虑)。

The only point that worries me is #3 (in-place updates), because it's quite inconvenient.唯一让担心的是#3(就地更新),因为它很不方便。

  • The data is in JSON数据为 JSON

Which means that documents are quite large (BigData, network bandwidth, speed), and having descriptive key names actually hurts, since they add up to the document size.这意味着文档非常大(大数据、网络带宽、速度),并且具有描述性的键名实际上是有害的,因为它们加起来等于文档大小。

plus some more :再加上一些

  • It doesn't support transactions它不支持交易

It means that enforcing uniqueness of one field across all documents is not safe, for example, enforcing that a username is unique.这意味着在所有文档中强制一个字段的唯一性是不安全的,例如,强制用户名是唯一的。 Another consequence of CouchDB's inability to support the typical notion of a transaction is that things like inc/decrementing a value and saving it back are also dangerous. CouchDB 无法支持事务的典型概念的另一个后果是,诸如增加/减少值并将其保存回来的事情也是危险的。 There aren't many instances that we would want to simply inc/decrement some value where we couldn't just store the individual documents separately and aggregate them with a view.没有多少实例是我们想要简单地增加/减少一些值,我们不能单独存储单个文档并将它们与视图聚合。

  • Relational data关系数据

If the data makes a lot of sense to be in 3rd normal form, and we try to follow that form in CouchDB, we are going to run into a lot of trouble.如果数据采用第三范式很有意义,而我们尝试在 CouchDB 中遵循这种形式,我们将遇到很多麻烦。 A possible way to solve this problem is with view collations, but we might constantly going to be fighting with the system.解决这个问题的一种可能方法是使用视图排序规则,但我们可能会不断地与系统作斗争。 If the data can be reformatted to be much more denormalized, then CouchDB will work fine.如果数据可以重新格式化为更加非规范化,那么 CouchDB 将正常工作。

  • Data warehouse数据仓库

The problem with this is that temporary views in CouchDB on large datasets are really slow.问题在于 CouchDB 中大型数据集的临时视图非常慢。 Using CouchDB and permanent views could work quite well.使用 CouchDB 和永久视图可以很好地工作。 However, in most of cases, a Column-Oriented Database of some sort is a much better tool for the data warehousing job.然而,在大多数情况下,某种类型的面向列的数据库对于数据仓库工作来说是一个更好的工具。

But CouchDB Rocks!但是 CouchDB 太棒了!

But don't let it discorage you: NoSQL DBs that are written in Erlang (CouchDB, Riak) are the best, since Erlang is meant for distributed systems.但是不要让它让您失望:用 Erlang(CouchDB、Riak)编写的 NoSQL DB 是最好的,因为 Erlang 是为分布式系统设计的。 Have fun with Couch!有沙发的乐趣!

2 more things, which make me cry when using CouchDB (though it's awesome):还有两件事让我在使用 CouchDB 时哭了(虽然它很棒):

  • It is not designed for frequently updated data它不是为频繁更新的数据而设计的
  • It doesn't have built-in fulltext search它没有内置的全文搜索
  • Lack of reader ACLs (does exist for writers, however)缺少读者 ACL(但是对于作者来说确实存在)

As an old Lotus Domino pro I was looking to CouchDB as an alternative for a new project I'm kicking off and found the limits on readers to be very weak in Couch vs. Domino.作为一名老 Lotus Domino 专家,我希望将 CouchDB 作为我正在启动的新项目的替代方案,但发现 Couch 与 Domino 对读者的限制非常弱。 In my app security is an important consideration and Couch would require a middleware layer to handle reader security.在我的应用程序中,安全性是一个重要的考虑因素,Couch 需要一个中间件层来处理阅读器的安全性。

If you have database in which it's okay that all defined users can see all the documents, then Couch looks like an interesting platform.如果您的数据库中所有定义的用户都可以看到所有文档,那么 Couch 看起来是一个有趣的平台。

If restricting reads is needed then you'll need to look to a middleware solution or consider another alternative.如果需要限制读取,那么您需要寻找中间件解决方案或考虑其他替代方案。

Note to CouchDB developers: Improve the platform security options. CouchDB 开发人员注意事项:改进平台安全选项。 I realize they will diminish performance when used but note that and make the option available.我意识到它们在使用时会降低性能,但请注意并提供该选项。

Now back to determining which database to use...现在回到确定要使用的数据库......

  • currently no support for ad-hoc queries (might change with advent of UnQL)目前不支持即席查询(可能会随着 UnQL 的出现而改变)
  • lack of binary protocol support for faster communication缺乏二进制协议支持以加快通信速度
  1. Lack of support for data archiving - No official support for data缺乏对数据归档的支持——没有官方对数据的支持
    archiving is provided with couch db open source distribution.归档是随 couch db 开源分发提供的。
  2. Deleting records from db is not straightforward从 db 中删除记录并不简单
  3. No option to set a expire (TTL) flag for documents没有为文档设置过期 (TTL) 标志的选项

It's nothing to do with CouchDB itself, but being a relative newcomer on the scene means that most sysadmins are still unfamiliar with it and won't allow it anywhere near "their" data centers.这与 CouchDB 本身无关,但是作为一个相对较新的人,大多数系统管理员仍然不熟悉它,并且不会允许它靠近“他们的”数据中心。 If you're in a situation where you're deploying to an environment you don't control yourself, this can be quite the battle.如果您处于部署到无法控制自己的环境的情况,这可能是一场战斗。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM