DEV Community

mohamed ahmed
mohamed ahmed

Posted on

CAP Theorem

Image descriptionWhat is the CAP Theorem?
The CAP theorem is a theorem about distributed computing systems; it has been stated in various forms over the years. The original statement of the theorem by Eric Brewer states that a computer system can at best provide two of the three properties from the following list:

  • Consistency: means that the nodes will have the same copies of a replicated data item visible for various transactions. A guarantee that every node in a distributed cluster returns the same, most recent, successful write. Consistency refers to every client having the same view of the data. There are various types of consistency models. Consistency in CAP refers to sequential consistency, a very strong form of consistency.

  • Availability means that each read or write request for a data item will either be processed successfully or will receive a message that the operation cannot be completed. Every non failing node returns a response for all read and write requests in a reasonable amount of time.

  • Partition tolerance means that the system can continue operating if the network connecting the nodes has a fault that results in two or more partitions, where the nodes in each partition can only communicate among each other. That means, the system continues to function and upholds its consistency guarantees in spite of network partitions. Network partitions are a fact of life. Distributed systems guaranteeing partition tolerance can gracefully recover from partitions once the partition heals.

we can use this data model options for :
1- Consistency and Availability: sqlserver, mysql, postgre.
2- Consistency and Partition tolerance: mangodb,redis.
2- Partition tolerance and Availability: cassandra,couchdb.

Top comments (1)

Collapse
 
khairallah profile image
Khairallah AL-Awady

Thank you for sharing this, Mohamed!