TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Please stop calling databases CP or AP

200 点作者 martinkl大约 10 年前

10 条评论

haberman大约 10 年前
The article convinced me that talking about databases as CP or AP is not very useful.<p>The article did <i>not</i> convince me that CAP-centered thinking is itself harmful or counterproductive. It&#x27;s true that C-Consistency and A-Availability are relatively blunt definitions in a landscape of diverse and subtle possible semantics. But their usefulness is that they represent our intuitive notions of what a database <i>should</i> do.<p>If it were possible and had good performance, every single database system would provide C, A, and P, because it would make distributed databases <i>much</i> easier to reason about and program against. Intuitively, it really seems like a database <i>ought</i> to read the data that was most recently written. And it sure would be nice if a distributed database could somehow magically remain available and consistent even in the presence of a partition.<p>C, A, and P are useful because they are a yardstick against which we can measure a distributed database&#x27;s actual capabilities against what a distributed database could do in an ideal world. The real world will fall short of that, and the CAP theorem gives a vocabulary for which part(s) of the ideal world real databases cannot satisfy.<p>For example, even in this article CAP terminology is used to describe interesting edge cases in ZooKeeper which, despite having generally strong consistency guarantees, does not always guarantee full capital-C Consistency.
评论 #9526528 未加载
评论 #9526660 未加载
jbangert大约 10 年前
very broad theorems like CAP (and e.g. The halting problem) are still very useful for proving things by reduction. Instead of talking about nodes failing, you could talk about a network partition isolating just that one node (sure, the node might process some things on its own, without input, or not --because it crashed-- but for CAP that is totally out of scope, and part of the underlying algorithm). Instead of talking about multi object transactions, it talks about anything that implements a register - which includes multi object transaction systems.<p>CAP therefore shows what real-life trade offs are feasible in the first place ( of course, there are still systems allowed by CAP that might be impossible for other reasons).
评论 #9525684 未加载
评论 #9525698 未加载
jellofiend84大约 10 年前
What I dislike about articles like this is the author doesn&#x27;t really talk about what we should be calling databases.<p>While calling one CP or AP may not correctly capture all the nuance of what those terms really mean it does give the user a quick idea of the capabilities of the database without having to go into a mutli-paragraph technical breakdown.<p>It&#x27;s like describing a house as &quot;orange&quot;, there are a million shades of &quot;orange&quot; and it might actually be closer to red or yellow but it gives a quick idea of what the house looks like. I feel the description CP and AP does the same, it gives a quick overview of the capabilities and if that interests you, one should be able to dig in deeper to the more technical details.
评论 #9526386 未加载
评论 #9526219 未加载
ddispaltro大约 10 年前
It&#x27;s natural to reduce things to simple terms. I think CAP theorem caught on because previously people didn&#x27;t know how to characterize distributed systems in an easy way and this gave them a framework and vocabulary to do it.<p>It&#x27;s the same reason why companies create some index in their product (like New Relic AppDex), to take something complex and simplify it so it can be compared.
antirez大约 10 年前
The article is good, however probably there is some issue here: &quot;so quorum operations are not CAP-available (at least temporarily, until the database sets up additional replicas on the minority side).&quot;<p>Availability is an eventual property, so technically speaking if the minority partition within a non-infinite amount of time always recovers and is able to provide a reply for our query, it is Available from the POV of CAP. However this requires the DB to be always able to create new replicas in the minority side and eventually reply to the query, and I&#x27;m not sure this is the case in Dynamo-alike systems when there is a single-node partition.
评论 #9540403 未加载
MCRed大约 10 年前
I agree. I feel it&#x27;s time for a better, modern, clear elucidation of these issues- something of which the CAP theorem would be a subset.<p>And on top of that, I&#x27;d love a simple test harness that will run a distributed database thru its paces and produce a report.<p>Call it Bender, or something and then we can talk about the Bender characteristics and the Bender Report and say &quot;this database passed the Bender report&quot; or &quot;bender found this database fails in this way during partitions: A &amp; B&quot;.<p>This would make it relatively easy to compare systems relatively objectively.<p>Too often well meaning people have chosen poor databased for production systems (including bitcoin financial transactions companies!) because they didn&#x27;t understand the issues well enough.<p>Such an open source project would be open to criticism and improvement and hopefully reasonable objective, and thus take it out of the realm of vendor propaganda and into the realm of broad understanding.
评论 #9525968 未加载
评论 #9526161 未加载
ble大约 10 年前
Impossibility results are really good for proving that one or more things are impossible.<p>The CAP theorem is an impossibility result.
评论 #9530211 未加载
jongraehl大约 10 年前
The article presents a really dumb argument: that because CAP only proves it&#x27;s impossible to have CP and AP for a single record, and we care about more than one record, we shouldn&#x27;t use the CAP impossibility result.<p>&gt; The CAP system model is a single, read-write register – that’s all. For example, the CAP theorem says nothing about transactions that touch multiple objects: they are simply out of scope of the theorem, unless you can somehow reduce them down to a single register. [WHICH YOU CAN. DUH. SINGLE-REGISTER IMPOSSIBILITY OF CONSISTENCY APPLIES TO ALL N&gt;=1]
vogan42大约 10 年前
When a partition happens, you cannot communicate, you can choose to be available, or consistent.<p>If you choose to be available, for all operations at all disconnected sites, you may need to resolve conflicts in some fashion when or if the partition resolves.<p>If you choose to be consistent, you may need to deny operations to some portion of sites or for some portion of operations.<p>I find the ATM example to be very useful, I also try to whenever possible understand the system in terms of ledgers and accounting...they have been solving these problems also for a long time.<p>The formal definitions are very useful, and I would argue have unfortunately been lost in the noise. People are often trying to understand and compare many different and sometimes quickly evolving technologies, and these working definitions and misinterpretations seem to be largely related to misunderstandings or in some cases fit to the terminology of a specific vendor (which can be very confusing!)<p>It is also very useful to test your use cases and what you can tolerate in terms of consistency, latency, and availability with specific implementations.<p>I think a lot of the problem is that marketing material and documentation have collided in a similar fashion to reporting and advertising.<p>The unfortunate message seems to be: buyer beware<p>I think a similar thing has happened probably many times before, relational databases for instance and isolation levels are rarely discussed in terms of the formal definitions and much more often the vendor specific definitions.<p>My maybe much weaker message&#x2F; take away would be: define the terms that may be ambiguous so that you can get to the real fun of the ideas !
Dylan16807大约 10 年前
It irks me whenever something trying to clarify CAP insists that you can&#x27;t choose CA. You can. In the real world you can&#x27;t <i>avoid</i> partitions, but you don&#x27;t have to <i>tolerate</i> them.<p>The rule for Availability is that non-failing nodes must respond. If you detect a partition, you can fail the node. Make a system that shuts down when it loses a connection and you can be CA.
评论 #9529598 未加载
评论 #9529749 未加载
评论 #9528913 未加载