Distributed system data consistency level

Distributed consistency

Important issues in distributed systems to be solved is to copy the data.

Distributed systems for data replication needs generally come from two reasons:

  • In order to increase the availability of the system , to prevent single point of failure due to unavailability
  • Improve overall system performance by load-balancing technology to make copies of the data in different places are able to provide services for users.

The so-called distributed consistency, refers to the introduction of data replication mechanism in a distributed environment, the data between different nodes that may arise, and data inconsistencies can not rely on their own computer applications to solve.

Simply put, while data consistency refers to a copy of the data is updated, it must ensure that it is possible to update the other copy, otherwise the data between different copies will no longer be the same.

Some may think this solution:

Action will be written blocked until after the data has been copied, the write operation to complete.

This seems able to solve the problem, when there are scenarios when a write request, the system performance will be a sharp decline very much.

In general, we are unable to find a consistent solution to meet all system properties of distributed systems. So how are we to ensure data consistency, without affecting the performance of the system is running, each distributed systems is important to consider and weigh.

So there have been less consistent level.

Strong consistency

This level of consistency is the most user intuitive, it requires the system writes what, what is also read out , the user experience is good, but realize it is often a great impact on system performance .

Weak consistency

After this level of consistency restraint system after writing success, does not promise immediate value can read the writing, nor how long after specific commitments to achieve data consistency, but as far as possible to ensure a certain time level, data can be to achieve a consistent state. Weak consistency can also be subdivided:

  • Session Consistency: level of consistency is only guaranteed for the value written in the same session, the client can immediately read the same value, but other sessions can not be guaranteed.
  • User Consistency: level of consistency is only guaranteed for the value written in the same user can immediately read the same value, but other users can not be guaranteed.

The final consistency

The final consistency is the special case of a weakly consistent, the system will guarantee within a certain time, to reach a consistent state of the data. The reason here will eventually consistent singled out, because it is weak consistency very important kind of consistency model, is the industry on data consistency large distributed systems more respected model.

Reference:
"From Paxos ZooKeeper distributed consensus principle and practice to" Ni super forward

Guess you like

Origin blog.csdn.net/u013568373/article/details/91458102