Senior
What is the CAP theorem?
sobes.tech AI
Answer from AI
The CAP theorem states that a distributed system cannot simultaneously guarantee all three properties:
- Consistency: all nodes see the same data at the same time.
- Availability: every request receives a response (successful or error).
- Partition tolerance: the system continues to operate despite network splits.
Due to network partitions, the system must choose between consistency and availability. For example:
- CP systems sacrifice availability for consistency.
- AP systems sacrifice consistency for availability.
This is a fundamental limitation in designing distributed databases and services.