Monday, September 19, 2011

Brewer's Conjecture and the Feasibility of Consistent, Available, Partition-Tolerant Web Services

The basics of the CAP theorem states that it is impossible to provide all 3 of consistency, availability, and partition tolerance at the same time for internet services.  Only 2 out of the 3 can be provided at the same time.  Consistency is defined as if operations on an object were completed on a single instance of the object.  Availability is defined as requiring all requests to a non-failing node must result in a response.  Partition tolerance means the system must tolerate when the network may lose arbitrarily many messages from one node to another.  The authors prove that it is impossible to provide an object which has atomic consistency and availability in any asynchronous network model, since it is impossible to determine if a message is lost or arbitrarily delayed.  In a synchronous network model, weaker consistency can be achieved, and there can be bounds in the length of inconsistency after the network heals.  This is possible by using timeouts and basing the bounds on the timeouts.  These results are very important and relevant to internet services today.  Most services are distributed over many nodes, and even across several datacenters.  The network is not 100% reliable so partitions are always possible.  Therefore all developers must take into account the tradeoffs between availability and consistency when designing the system.

I think this CAP result will be increasingly important in the future because internet services will be increasingly global.  Data and services will span across datacenters and regions.  The datacenter will be the new computer and the world will be the new datacenter.  This means the networks between the datacenters will be even more unreliable and unpredictable.  The probability of partitions will be greater and so this CAP theorem will be relevant more frequently.  Future services and applications will have tolerate more partitions and have to be developed with partitions and high latencies in mind.  This is a departure from the programming model today where programs for single machines or single datacenters are far more predictable.

No comments:

Post a Comment