Why is C in CAP theorem not same as C in ACID?
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)
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". (From Wikipedia.)
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.
精彩评论