CAPTheorem.md (1294B)
1 # CAP Theorem 2 3 **Source:** [https://en.wikipedia.org/wiki/CAP_theorem/](https://en.wikipedia.org/wiki/CAP_theorem/) 4 5 **Definition:** The CAP theorem states a distributed data store can only provide at most two of the following characteristics: 6 7 1. Consistency 8 2. Availability 9 3. Partition tolerance 10 11 ## Consistency 12 13 Consistency means every client sees the same data at the same time, regardless of which node it connects to. To achieve this, a write to one node must be instantly replicated across all nodes, and the write is only considered 'successful' once all nodes reflect the write. 14 15 ## Availability 16 17 Every request received by a non-failing node must result in a response. 18 19 ## Partition Tolerance 20 21 The system continues working despite an arbitrary number of messages being dropped between nodes. 22 23 ## Accepted Tradeoffs 24 25 Since networks are generally fallible, partition tolerance is often a necessary tradeoff to accept. As such, one is then left with a choice between consistency and availability. 26 27 If consistency is choose, the system will return errors or a time out if information can't be guaranteed to be up to date due to network partitioning. 28 29 If availability is chosen the system will try to return the most up to date information, even if it might not be totally up to date.