The basic theory---cap/base of the consistency of large web sites

Source: Internet
Author: User

Recently in the "large web system and Java middleware Events" This book, a lot of harvest.

Distributed transactions hope that in a multi-machine environment can be similar to the same as a stand-alone system to achieve strong consistency, which requires a greater cost. In some scenarios, the acceptance state is not always consistent with the moment, as long as the end is always on the line.

CAP (consistency availability partition-tolerance)

Consistency: That is, all nodes read the same data at the same time, which is the consistency of the data.

Availability: Ensure that every request can receive a feedback, whether successful or unsuccessful. The point here is that the system must be responsive.

Partition-tolerance: Even if there are some problems in the system or if there is a loss of information, the system will continue to run. This is known as partition tolerance.

However, the above three items cannot be satisfied in the distributed system at the same time.

1 Select CA, discard partition tolerance, enhance consistency and availability. This is actually the choice of the traditional stand-alone database.

2 Select AP, discard consistency, pursue partition tolerance and availability. This is a design-time choice for many distributed systems, such as many nosql systems.

3 Choose CP, abandon usability, pursue consistency and partition tolerance. The availability of this option is low, and the problem of the network is directly unavailable to the entire system.

As can be seen from the above analysis, in distributed systems, we generally choose to enhance availability and partition tolerance and sacrifice consistency, but first to meet a and p, and then see how to solve the problem of C.

BASE (basically Available Soft State eventually consistent)

Basically Available: Basic available, allow partition to fail.

Soft state: Soft states, accept the state of a period of time out of sync.

Eventually consistent: ultimately consistent, ensuring the state of the final data is consistent.

When we select A and p in the CAP in a distributed system, for C, the strategy we adopt is to ensure that the final consistency is guaranteed, that is, all nodes are not immediately consistent after the data changes, but ensure that they are eventually consistent. In a large web site, in order to better maintain scalability and availability, there is generally no choice for strong consistency, but the adoption of a final consistent strategy.

The basic theory---cap/base of the consistency of large web sites

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.