🤓🧐Data consistency and its types
The concept of data consistency is complex and ambiguous, and its definition may vary depending on the context. In his article, which was translated by the VK Cloud team, the author discusses the concept of "consistency" in the context of distributed databases and offers his own definition of this term. In this article, the author identifies 3 types of data consistency:
1. Consistency in Brewer's theorem - According to this theorem, in a distributed system it is possible to guarantee only two of the following three properties:
Consistency: the system provides an up-to-date version of the data when it is read
Availability: every request to a node that is functioning properly results in a correct response
Partition Tolerance: The system continues to function even if there are network traffic failures between some nodes
2. Consistency in ACID transactions - In this category, consistency means that a transaction cannot lead to an invalid state, since the following components must be observed:
Atomicity: any operation will be performed completely or will not be performed at all
Consistency: after the completion of the transaction, the database is in a correct state
Isolation: when one transaction is executed, all other parallel transactions should not have any effect on it
Reliability: even in the event of a failure (no matter what), the completed transaction is saved
3. Data Consistency Models - This definition of the term also applies to databases and is related to the concept of consistency models. There are two main elements in the database consistency model:
Linearizability - replication of a single piece of data across multiple nodes affects its processing in the database
Serializability - simultaneous execution of transactions that work with several pieces of data affects their processing in the database
More details can be found in the source: https://habr.com/ru/companies/vk/articles/723734/
Post #561
651