Consistency (database systems)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Consistency in database systems refers to the requirement that any given database transaction must only change affected data in allowed ways. Any data written to the database must be valid according to all defined rules, including constraints, cascades, triggers, and any combination thereof. This does not guarantee correctness of the transaction in all ways the application programmer might have wanted (that is the responsibility of application-level code) but merely that any programming errors cannot result in the violation of any defined rules.

As an ACID guarantee[edit]

Consistency is one of the four guarantees that define ACID transactions; however, significant ambiguity exists about the nature of this guarantee. It is defined variously as:

  • The guarantee that any transactions started in the future necessarily see the effects of other transactions committed in the past[1][2]
  • The guarantee that database constraints are not violated, particularly once a transaction commits[3][4][5][6]
  • The guarantee that operations in transactions are performed accurately, correctly, and with validity, with respect to application semantics[7]

As these various definitions are not mutually exclusive, it is possible to design a system that guarantees "consistency" in every sense of the word, as most relational database management systems in common use today arguably do.

As a CAP trade-off[edit]

The CAP Theorem is based on three trade-offs, one of which is "atomic consistency" (shortened to "consistency" for the acronym), about which the authors note, "Discussing atomic consistency is somewhat different than talking about an ACID database, as database consistency refers to transactions, while atomic consistency refers only to a property of a single request/response operation sequence. And it has a different meaning than the Atomic in ACID, as it subsumes the database notions of both Atomic and Consistent."[1]

See also[edit]

References[edit]

  1. ^ a b http://webpages.cs.luc.edu/~pld/353/gilbert_lynch_brewer_proof.pdf "Brewer’s Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services"
  2. ^ Ports, D.R.K, Clements, A.T, Zhang, I, Madden, S, Liskov, B. "Transactional Consistency and Automatic Management in an Application Data Cache". MIT CSAIL. 
  3. ^ Haerder, T, Reuter, A. (December 1983). "Principles of Transaction-Oriented Database Recovery". Computing Surveys 15 (4): 287–317. 
  4. ^ Mike Chapple. "The ACID Model". About. 
  5. ^ "ACID properties". 
  6. ^ Cory Janssen. "What is ACID in Databases? - Definition from Techopedia". Techopedia.com. 
  7. ^ "ISO/IEC 10026-1:1998 - Information technology -- Open Systems Interconnection -- Distributed Transaction Processing -- Part 1: OSI TP Model".