6

We know that for Database Systems - the Consistency in ACID properties is part of the acronym:

A - Atomicity

C - Consistency

I - Isolation

D - Durability

We know that for NoSQL Systems, the Consistency in the CAP Theorem is part of the acronym:

C - Consistency

A - Availability

P - Partition tolerance

Michael Nygard writes:

So it turns out that "consistency (predicate)" and "consistency (history)" are two distinct ideas that happen to share a word. It is always an error to substitute the distributed systems definition of "consistency" for the C in ACID.

My question is: Is the C in ACID is not the C in CAP?

  • 2
    I would suggest that you actually spell out ACID and CAP. It might be spelled out in the link, but links die a lot sooner than you think. Also expand a little on why you think each is one consistency or the other. Your question might be very good but it can be a bit difficult to see without reading the links. – Bent Dec 25 '17 at 14:24
5

The meanings are slightly different I think. In short:

  • Consistency in ACID means that no dataset may be an invalid state or represents data which are semantically invalid after a transaction is committed ("internal consistency").

  • Consistency in CAP means that after a transaction is executed this dataset must be updated in all replications too.

2

I would say they talk about different aspects of the same thing.

Lets say we have lost the C in CAP. ie one of our databases nodes has had an update which hasn't been propagated to the other yet. The update in question removes a row which satisfies a foreign key constraint.

A read comes in and hits the updated node, retrieving the Foreign table. A second read comes in and hits the non-updated node, retrieving the Primary table.

Now the client has data which appears to have violated the FK Constraint. The C in ACID

So you can say that the difficulty in applying a consistent (ACID) transaction across servers where there may be network loss between them leads to the Consistency problem in CAP.

Now when you get down to the details its not really helpful to talk about this 'Generic Consistency' idea because details matter, and generally you will have consistent transactions on EACH node, the problem is in applying them to all the nodes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.