CAP theorem and the theory BASE

CAP theorem and the theory BASE

Tags (separated by spaces): Operating System


### CAP Theorem

CAP theorem: a distributed system can only meet two of which are the most consistency (Consistency), availability (Availability) and partitions fault tolerance (Partition tolerance).

Consistency (Consistency)

  • all nodes see the same data at the same time.

    Availability (Availability)

  • Reads and writes always succeed .

Partition fault tolerance (Partition tolerance)

  • the system continues to operate despite arbitrary message loss or failure of part of the system .

### CAP weigh

  • Zoning fault tolerance: Project project is distributed fault tolerance is so partition must be used, even if the availability of each service is 99.999% but in many services, the overall availability of the system will be a great fall, so keep partition P fault tolerance is very important.

  • Consistency: For information on the accuracy of these banks not a hint of concessions distributed project must achieve consistency with respect to the partitions fault tolerance and availability, the consistency of the position to be much higher than the other.
  • Availability, in addition to banks for this type of enterprise, high availability is more important, as long as the final BASE ensure consistency can sacrifice strong consistency to provide a more stable service, so even though it may reduce the part of the user experience , but the user will not cause the loss of such a serious situation.

# BASE theory

BASE CAP theory is an extension of the theory, the core idea is that even if unable to do so strong consistency, but the application of appropriate methods can be used to achieve eventual consistency.

Basic available (Basically Available)

The basic means of distributed systems available in the event of a failure, you can lose some of availability, but to ensure that the core functions are available.
Electricity supplier big promotion when, in response to the surge in traffic, some users may be directed to downgrade page, service level downgrade may only provide services, which is reflected in the loss of part availability - looks like a few years ago when two-eleven Taobao shopping when one comes across a case of such a service reduction.

Soft state (Soft State)

Soft state refers to allow the system to an intermediate state, the intermediate state will not affect the overall system availability. Usually a distributed storage have at least three copies of the data, allowing a copy of the delay in time reflects the soft state synchronization between nodes, MySQL replication asynchronous replication is a reflection of the soft state.

The final consistency (Eventual Consistency)

The final consistency refers to all copies of the data in the system over time, ultimately to a consistent state. Instead weak consistency and strong consistency and ultimately weak consistency is a special case of weak consistency.

# ACID and BASE differences and connections

ACID is commonly used in traditional database design, the pursuit of strong consistency model. BASE is supported by large-scale distributed systems, high availability consistency proposed by sacrificing strength.
ACID and BASE represent two opposite design philosophy, distributed scene system design, the consistency of the system components requirements are different, so will the use of binding ACID and BASE.


Guess you like

Origin www.cnblogs.com/A-FM/p/11440648.html