CAP Theorem

The CAP Theorem suggests that in distributed architecture, you can pick only two of the following three:

  • Consistency: Every read gets the most recent copy of the data
  • Availability: Every request receives a response
  • (Network) Partition Tolerance: The system continues to operate despite network partition

Another way to look at the CAP theorem is: When the network gets partitioned, either consistency or availability can be guaranteed, not both. The following diagram illustrates how the CAP theorem works when the network is partitioned: 

A row is updated in Node 1 as shown in the preceding figure. Before Node 3 receives the update propagation, it gets a request for the same row. Now Node 3 has two choices--either provide the copy of the row it has (which may be stale) or deny the request. In the first case, it is compromising on consistency and in the second case, on availability. 

In essence, every distributed database needs to pick its poison. Cassandra has picked consistency to provide high availability.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset