CAP theorem


CAP theorem states that it is impossible for a distributed computer system to simultaneously provide consistency, availability, and partition tolerance. The CAP theorem has attained almost mythical status in technological start-ups and it's widely used to discredit older technologies (e.g. relational databases) and to point out their unsuitability for Internet-scale applications. The CAP theorem was posited in 2000 by Eric Brewer, but only as a conjecture not as a theorem. When Seth Gilbert and Nancy Lynch proved it as a theorem two years later, they substantially reduced its scope, especially by narrowing the definition of consistency. One of the best talks of QCon London 2014 was by Michael Nygard on Exploiting Loopholes in CAP. In his talk Nygard presented 10 approaches how to simultaneously achieve consistency, availability, and partition tolerance by changing the definitions of these terms, something that can be done in many real-life scenarios. For example, if we limit ourselves to use only Conflict-free Replicated Data Types (CRDT) we can still have a consistent and available system even in the case of system's partition since CRDTs blend seamlessly once the system unifies again. Similarly, if we assume that 100% system's partition is impossible (e.g. by relying on GPS as Google Spanner does), we can build quite consistent and available system even if network itself is partitioned.

So, next time when you'll be using the CAP theorem in an argument, think again if the premises required for CAP theorem to hold are valid in your specific case, too.

Enhanced by Zemanta