To dream the impossible dream
To fight the unbeatable foe
To bear with unbearable sorrow
To run where the brave dare not go
— An extract from “Mad men are children of God” by Dale Wasserman
CAP theorem in distributed systems means that a distributed system can deliver only two of three desired characteristics: consistency, availability, and partition tolerance (the ‘C,’ ‘A’ and ‘P’ in CAP).
What is CAP
Gilbert and Lynch(people who proved this theorm) describe consistency as any read operation that begins after a write operation must return that value, or the result of a later write operation.
Sounds simple, lets look at another way of looking at it.
All the consumer or client should see that same data at any point of time irrespective of the distributed nodes they are querying.
From system perspective, whenever a data is written to the same node. It should be replicated to all the nodes in the system before system is being queried again.
Gilbert and Lynch(people who proved this theorm) describe availability as every request received by a non-failing node in the system must result in a response.
Another way to state this—all working nodes in the distributed system return a valid response for any request, without exception.
Gilbert and Lynch describe partitions as the network will be allowed to lose arbitrarily many messages sent from one node to another.
Partition tolerance means that the cluster must continue to work despite any number of communication breakdowns between nodes in the system.
Thats all for this one. I will be explaining the proof of CAP theorm with real life systems in part 2. Stay tunned!!!