The Elastic DBMS Blog

October 27, 2011

CAP Theorem Part 4: The relationship between Consistency, Availability, and Partition Tolerance

This is the fourth of a six part blog post about the CAP Theorem. You can read the first part here. You can download all six parts in one document here.

Relationship between TC, TA, and TP

Assertion

We assert that in a service as described in the previous post,
TC + TA ≥ TP
In other words, a distributed service that guarantees TC Consistency, and guarantees a response in less than TA, cannot tolerate network partitions lasting longer than (TC + TA).

Proof

The proof of the assertion is provided by contradiction. Assume for the purposes of this proof that,

TP > TC + TA

In other words we assume that a distributed service that guarantees results that are TC Consistent, and guarantees a response in less than TA, can tolerate network partitions lasting longer than (TC + TA).

We show that this is impossible.

cap-3-img-1-940x473.png

Consider the figure above depicting the period of time TP during which some two nodes (nA and nB) in the service were unable to communicate with each other. As depicted in the figure, the network partition begins at TSTART and lasts for duration TP.

As TC + TA < TP, we should be able to find a time ‘t’ such that:

  • TSTART < t < TSTART + TP, and
  • TSTART < t + TC + TA < TSTART + TP.

In other words, the interval of time [t, t + TC + TA] must lie entirely within [TSTART, TSTART + TP], the interval when the nodes nA and nB are unable to communicate with each other.

Consider further that at some point of time in the interval [TSTART, t], a request (R1) is received by node nA, and a request (R2) is received by node nB at time t + TC.

As TC + TA < TP, the node nB should be able to respond to the request R2 before the end of the network partition and that response would be T Consistent.

In order for this to be possible, the effect of the request R1 processed by nA must have been propagated to nB before the end of the network partition between nA and nB, and that is a contradiction as no messages from nA could have made it to nB before during the partition.

We therefore conclude that

TC + TA ≥ TP,

or a distributed service that guarantees TC Consistency, and guarantees a response in less than TA, cannot tolerate network partitions lasting longer than (TC + TA).

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.

Take the next step