Understanding the CAP
So what does the 3 letters of CAP actually mean?
Concurrently executing queries see the same valid and consistent data at the same time.
This is a guarantee that every request receives a response about whether it succeeded or failed.
Also known as fault-tolerance, this is a guarantee that the system continues to operate despite arbitrary message loss.
Because no distributed system is capable of satisfying all three guarantees at the same time, a tradeoff must be made. While traditional databases make that decision for us, NoSQL databases provide these guarantees as tuning options. Database vendors must always decide which two to prioritize. The options are as follows:
- Availability is compromised in favour of consistency and partition-tolerance.
- Partition-tolerance is forfeited in favour of consistency and availability.
- Consistency is compromised but systems are always available and can work when parts are partitioned.
Traditional SQL databases place a high priority on consistency and fault-tolerance and have generally as a result chosen to go with the first option above and forfeit high availability. NoSQL databases frequently leave that decision to the application operations team and provide configuration options so that the preferred options can be chosen based on the application use case.