CAP theorem for SQL and NoSQL databases
CAP theorem was defined by Eric Brewer in 1999 and presented at the 19th Annual ACM Symposium on Principles of Distributed Computing (PODC) in 2000. This theorem states that a distributed data store can only provide two of the following guarantees:
- Consistency: This means when reading information, the data store returns the most recent written data or returns an error if it fails. This refers to regular SQL databases that use atomic operations to guarantee that data is written. If not, the system automatically rolls back to a previous data state.
- Availability: This means that all reads contain data, but it might not be the most recent.
- Partition tolerance: This is the most desired feature in a distributed system. It means that data is distributed in several nodes, helping to reduce downtime for the database. This means that if a node is down, just a small portion of data will be inaccessible:
Figure...