Design tradeoffs for distributed systems: Caps

Source: Internet
Author: User
Tags final

Write at the top:

1. Why learn and record distributed design concepts a series of related things

In the day-to-day system design review, there are often some colleagues throw concepts, high availability, consistency, and so on, they use these basic concepts to refute the original design of the system, but many people understand the usability, consistency and so on, are their own head thinking, Or the fundamental and most original expression of meaning is not a thing, in this case PK, like no longer a band of people in communication, in addition to the controversy, there is no substantial progress, so it is necessary to familiarize themselves with the theoretical basis to avoid laughable. In fact, there are a lot of similar examples, the domestic technical staff like to put some of the word fuzzy, confused and talk about. For example, XX cloud, the actual sale is a VPS and a small part of SaaS, this is called cloud computing?

2. What are you going to say?

Distributed system design in the review, the most controversial place, in fact, is the famous cap theory, this article also mainly to the cap theory of their own understanding and application

Cap theory

What is a distributed system

Part on different nodes, the system that work together through network is called Distributed system

What does the cap represent, respectively?

Consistency

(All nodes to the same data at the same time)

Availability

Reads and writes always succeed.

Partition tolerance

(the system continues to operate despite arbitrary message loss or failure of part of the system)

Consistency: After the update operation succeeds and returns to the client, all distributed nodes are fully consistent at the same time

Usability: Both read and write can succeed

Partition fault tolerance: The system can continue to service when the network failure occurs and the distributed nodes cannot communicate between them

What's the CAP's relationship

It states, that though its desirable to have consistency, high-availability and partition-tolerance in every system, unfor Tunately No system can achieve all three in the same time.

In the design of distributed systems, there is no one design that can meet the consistency, usability and partition fault tolerance 3 features at the same time

Note: Do not confuse weak consistency with final consistency into the CAP theory (confusing the concept of the pit really much)

Weak consistency, final consistency you can assume that there is nothing to do with the CAP's C, because the CAP's C is when the update operation is complete, and any node sees the data exactly consistent, weak consistency. The final consistency itself and the CAP's C consistency are violated, so you can see how ridiculous it is to pretend that your system has 3 features of CAP at the same time, perhaps more of the domestic scene is: An open person once on the podium to speak, immediately converted to marketing staff, even the most basic idea is not.

Here is a very large article cap-twelve-years-later-how-the-rules-have-changed, in fact, the changed is more in the way of thinking, and the cap theory is not changed

Why would that be?

Let's look at a simple question, a DB service built in two rooms (Beijing, Guangzhou), two DB instances provide both write and read

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.