In short the brewer's CAP theorem states that any database is either CA,CP or AP
Why do people consider Redis as a CP database?
The Replication chapter states that “Redis is not a CP system with strong consistency” and that “acknowledged writes can still be lost during a failover”.
That's why from CAP perspective, Redis is CP because it becomes unavailable in minority partitions. Please note it will still be available in majority partition. You can read more about Redis High Availability here. Refer para titled "Consistency under partitions" for details around Partitioning.
Redis Cluster does not guarantee strong consistency. In practical terms this means that under certain conditions it is possible that Redis Cluster will lose writes that were acknowledged by the system to the client. The first reason why Redis Cluster can lose writes is because it uses asynchronous replication.
How does Redis Cluster work? Redis Cluster works by sharding the data in a database. Sharding is a database partitioning scheme in which different rows in a database (or, in the case of Redis, key-value pairs) are distributed across multiple nodes, so that each node contains a portion of the data.
The CAP Theorem refers to distributed computer systems.
Since Redis is not per se distributed (clustering is under development) being CP/CA/PA depends on the clustering implementation.
@seppoo0010 is correct. It is more meaningful to speak of a Redis node in terms of Atomicity, Durability, etc.
Also note that CAP is a somewhat problematic paradigm. I second Dr. Brewer's recommendation of Coda Hale's informative rant. (See also comments by Daniel Abdi). Also note Jeff Darcy and Dan Weinreb's comments.
Stonebraker disagrees.
[Edit: Dan Weinreb's deep digging of CAP really is quite excellent. Highly recommended]
Finally, here is "the proof" of CAP.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With