Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to understand the "Availability" of the CAP theorem?

Tags:

database

I don't know if this is a proper question here.

As we know, in the CAP theorem, "A" means "Availability". On wikipedia, the explanation of "Availability" is:

Availability: a guarantee that every request receives a response about whether it was successful or failed

However, from the perspective of engineering, there is no ABSOLUTE availability. We can only say that the availability of a system is 5'9'(99.999%), or even 8'9', but we cannot say that the availability of a system is 100%, 100% available system does not exit in reality, even if the system has millions of duplicated nodes, right?

The CAP theorem proves that no system could satisfy the 3 requirements simultaneously. My question is, if a system claims to satisfy both "A" and "P", what is the accurate meaning of this "A"? 6'9' or even higher?

like image 891
ciphor Avatar asked Apr 09 '12 05:04

ciphor


2 Answers

I recommend that you avoid Wikipedia and instead read the definition as provided in the proof by Gilbert and Lynch.

"every request received by a non-failing node in the system must result in a response"

And the related footnote which answers your question

"Brewer originally only required almost all requests to receive a response. As allowing probabilistic availability does not change the result when arbitrary failures occur, for simplicity we are requiring 100% availability"

So if almost all requests receive a response or we allow for arbitrary failures to occur, a system can be considered to have high availability.

like image 115
fny Avatar answered Nov 07 '22 02:11

fny


The Availability in CAP means "All (non-failing) nodes are available for queries". It has NOTHING to do with the Wikipedia link, which is about "High Availability".

For example, the PAXOS algorithm is CP (no Availability property) because the minority nodes "shut up" during a partition. But if you need Consistency, then PAXOS is considered "High Availability".

Conversely, a single-node MySQL database server is CA (has the CAP Availability property). It can reboot (and be down for hours while it does BIOS check, FileSystem check, DB Repair, etc). When it finishes booting, it starts responding to queries again. That's perfect Availability (as per the CAP theorem), but horrible availability for "High Availability".

like image 39
BraveNewCurrency Avatar answered Nov 07 '22 03:11

BraveNewCurrency