Why is C in CAP theorem not same as C in ACID?
Asked Answered
K

3

12

My question is pretty simple, was looking for a simpler answer, Why is C in CAP theorem not same as C in ACID?

Read this HN thread.

Update

A Hitchhiker's Guide to NOSQL v1.0, slide 71 says: C in CAP = A+C (Atomic Consistency)

Kaveri answered 27/1, 2011 at 6:11 Comment(0)
S
12

Both C's stand for consistency, but the notion of consistency in CAP means that "all nodes see the same data at the same time" and the notion of consistency in ACID means that "any transaction the database performs will take it from one consistent state to another".

Sulphonate answered 27/1, 2011 at 6:40 Comment(0)
K
2

You cannot hardly have meaningful consistency without atomicity. This is why the CAP theorem defines the C in the way that it does.

Imagine this simple scenario:

There is a database with two accounts. There is no money coming in our out of the database. Just the money on the two accounts. In the database, money is moved between one account to another.

Without atomicity, the user could read the data when money has been deducted from one account while it has not yet been written to the other. In this case, the grand total of the two accounts would vary from read to read, something that should be impossible as "new" money is not leaving or entering the database.

To talk about consistency in any other way is like thinking about a Java boolean as being "nearly" true while the rest of the world reads it as false.

Kutenai answered 15/10, 2012 at 20:14 Comment(1)
BTW, in addition to what I answered above, when you here about other types of "consistency" such as "eventual consistency", call out that the emperor is naked. Leave the embarrassment of explaining to the client why the report reads the wrong amount to those developers who wish to "rename" the problem away. Sometime, the truth is simple and harsh. The new types of "consistency" are introduced because consistency does not scale horizontally and not scaling is not trendy. Unfortunately (or fortunately), nature, math and physics tend not honour human fashion (ask the foes of Galileo).Kutenai
T
0
  • Consistency (C) in ACID Properties is in the context of transactions in database systems.
    • Consistency ensures that the database remains in a valid state before and after the execution of a transaction. It prevents the database from entering an invalid state.
  • Consistency (C) in CAP theorem highlights the trade-offs in distributed systems.
    • Consistency means all clients see the same data at the same time no matter which node they connect to. This ensures all nodes have the same copy of data.
Template answered 4/5 at 7:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.