github / keybase / email

The CAP theorem isn't really about "choosing 2 of 3"

When I first learned about the CAP therorem, I thought you always had to choose 2 of these 3 guarantees:

But that's not exactly right.

First, you can't really pick Consistency and Availability: if you forfeit Partition tolerance, you basically loose both Consistency and Availability because you can't keep them in case of network partition. So you actually have to choose between CP and AP.

But even that isn't completely true. Unless your network is unstable, you can have both Consistency and Availability most of the time. You don't need to choose between one of these as long as your network isn't partitioned.

And even in case of network partition, you don't always have to choose the same guarantee: it might be benificial in some cases to preserve Consistency, while in some other it could be better to have Availability.