In distributed system theory, the CAP rule connects three key principles:
- Consistency: updates are performed in some system-selected order by all replicas. Queries return the most up-to-date values, and users see a single system.
- Availability: system responds to every user request, even when some nodes are down.
- Partition tolerance: system can tolerate network failures between subsystems.
The CAP rule states that you cannot achieve all three in a single system.
In practice, we cannot ignore network partitions. When there are no partitions, we can provide consistency and availability. But when there is, the system needs to choose between one (based on what is best suited for the application’s needs). When the partition is fixed, restore consistency and availability by performing reconciliation.