Distributed Transaction --- BASE theory

Some pictures from the summary References

problem:

  • Base theory why are they being made, what is the motive
  • Base and ACID differences and relations

Outline

       Previous CAP theory we know, but also know the reality of the network and other reasons, fault tolerance that the partition elements in most cases will be sent, then we can only strengthen both consistency and availability. In many cases, if we go to real-time data is not accurate, then maintain the availability will be even more important than consistency, we can not guarantee availability at the same time, maximize the greater consistency of it? Base proposed theory is that it provides a way to solve this problem.

       Here we'll learn to understand on the basis ACID Base theory.

ACID

       I remember at the time of first contact to learn MySQL is ACID, said that the database transaction operation to meet these four aspects, namely:

  • Atomic: Everything in a transaction succeeds or the entire transaction is rolled back. (原子性)
  • Consistent: A transaction cannot leave the database in an inconsistent state. (一致性)
  • Isolated: Transactions cannot interfere with each other. (隔离性)
  • Durable: Completed transactions persist, even when servers restart etc.(持久性)

BASE theory

The following summary from: https://www.cnblogs.com/xrq730/p/4944768.html , unoriginal

        BASE is the core idea of the theory: even if unable to do so strong consistency, but each application according to their operational characteristics, in an appropriate manner to enable the system to achieve eventual consistency . Let's look at the three elements of BASE:

Basic Available

       The basic means of distributed systems available in times of unpredictable failures, allowing lose some usability ---- Note that this is not equivalent to the system unusable. such as:

(1) loss of response time. Under normal circumstances, an online search engine needs to be returned to the corresponding user query results within 0.5 seconds, but due to a failure, the response time of the query result is increased by 1 to 2 seconds

(2) loss of system functionality: Under normal circumstances, the time for shopping at an e-commerce website, consumers can successfully complete almost every order, but in some holiday shopping season big promotion, because of consumers' surge in shopping behavior, in order to protect the stability of shopping system, some consumers may be directed to a page downgrade

Soft state

Refers to a soft state allows data system there is an intermediate state, and that there is the intermediate state will not affect the overall availability of the system, i.e. the system allows data synchronization process delay between the presence of the copy data of different nodes

The final consistency

       Eventual consistency emphasized that all copies of the data, after synchronization over time, eventually able to achieve a consistent state. Therefore, the nature of eventual consistency is the need to ensure that the final system to achieve data consistency, without the need for real-time systems guarantee strong consistency of the data.

       Overall, BASE theory-oriented large-scale high-availability scalable, distributed systems, and the traditional ACID properties of things are the opposite, it is completely different from the model ACID strong consistency, but obtained by sacrifice strong consistency availability and allow a period of time the data is inconsistent, but eventually reaches a consistent state . But, in an actual distributed scenario, different business units and components are different requirements for data consistency, so in a particular distributed system architecture design process, ACID BASE theoretical characteristics and will often together.

Eventual consistency model variants

The strength of consistency

Amazon CTO Werner Vogels that in 2008 published an article on the final consistency had a very detailed presentation
[English] All Things Distributed
[Translation] eventual consistency

to sum up

       Base article to learn the motivation and the theory put forward to explain the main content Base theory.

Reference material

Guess you like

Origin www.cnblogs.com/Benjious/p/11267131.html