DEV Community

Discussion on: What is CAP Theorem?

Collapse
 
tburette profile image
Thomas Burette

Simple and well written. Good links as well.
Most CAP Theorem explanations online are...not great at all. Some weird triangle or Venn diagram implying SQL databases are CA and explaining P the same way as A...

A few remarks on the subject of CAP:

  • You can make different choices for different part of the system. For example the money part of a system could be CP and the counting of the page views could be AP.
  • if your database is not distributed the CAP theorem doesn't apply : partition are impossible.
  • It's possible to have both C and A when there are no partitions. Some nosql vendors tried to justify not having consistent database even in the absence of a partition by saying "CAP says it's impossible to have C and A". Not really
  • Choosing to abandon Consistency of Availability makes life difficult : you have to program a partition mode. When the partition ends you have to perform some partition recovery to merge the data and fix incoherences that arose due to the left hand not knowing what the right hand did. It can get hairy.