'Is Consistency is responsible for not allowing users to see data which is not committed in ACID?
Which property gives assurance that multiple data readers won't see uncommitted data?
A. Isolation
B. Atomicity
C. Consistency
D. Durability
I believe the answer is C. Consistency . Am i correct ?
I would like to know examples
Solution 1:[1]
Which property gives assurance that multiple data readers won't see uncommitted data?
Rephrasing a little the question:
Which property gives the assurance that a write done by one transaction will not be visible to new transactions until that transaction is committed?
That is isolation.
Isolation also enables consistency, that is if you have a property such as "every user has one and only one bank account", then in the isolation mode called "read-uncommited", during a transaction that deletes a bank account and add another bank account to an user, in other words that replace a bank account with another, it is possible that other transactions see one user with two bank accounts. That is impossible in the isolation mode called snapshot.
With snapshot isolation, given a consistent database, given isolation of every transactions, each transaction will see consistent data.
All in all, ACID properties are interleaved in one place or another. That is useful to reason and explain stuff, but you need to pin a particular use-case to tell what ACID property or properties are involved.
I recommend reading Bernstein paper called 'Concurrency Control in Distributed Database Systems'
Solution 2:[2]
In the database user's view, consistency require that the uncommitted data is not seen by other users.
In the database implementor's view, isolation require that the uncommitted data can not be read by other users.
C and I are not independent, they are interleaved.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | amirouche |
| Solution 2 | yedf |
