cap theorem

less than 1 minute read

It is for distributed databases. And says that we can have only two out of three gurantees.

  • C(Consistency): every node returns same recent data
  • A(Availibility): every request gets response
  • P(Partition tolerance): system functions despite of partition/network failure

Options:

  • CA: rdbms
  • CP: single master or active/passive master, distributed database. ex:hbase
  • AP: muti master, distributed database. ex:cassandara, cosmosdb

Note: In distributed systems we deal with multiple machine so we would require partition tolerance so the only thing we have to choose is either consistency/availibilty.

CP

In this case we can recevice timeout from the application as availibilty will not be guranteed.

AP

In this case request receives newest version of data available as consistency will not be guranteed.

Comments