CAP theorem states that a distributed system can only have 2 of the following hold true:
- Consistency β every node has the most recent data. I.e. if you pick any node, you will see all of them report the same data.
- Availability β every request is fulfilled.
- Partition tolerance β the system continues operating when some nodes canβt communicate with each other.
- A network partition is when the communication between nodes break down and form two separate networks.
Put simply, the CAP theorem states that when a network partition happens, you must choose either consistency or availability, but never both, until the network partition is resolved.
- Either you allow updates to nodes, forfeiting consistency.
- Or you disallow updates to nodes, forfeiting availability. (sourced from ByteByteGo)