Home:ALL Converter>Redis availability and CAP theorem

Redis availability and CAP theorem

Ask Time:2019-12-28T21:22:00         Author:Nipuna Chandimal

Json Formatter

In CAP theorem, Redis is specified as a database which lacks availability (which has partition tolerance and consistency).

But there are many places where Redis is considered as a high availability key-value store.

CAP theorem and DBMS

What is right? I would be thankful if you could provide an in-depth answer.

Author:Nipuna Chandimal,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/59511275/redis-availability-and-cap-theorem
Vikram Rawat :

I would start by saying that there is no 'CA' category. Most systems are CA in absence of Network Partition.\n\nCAP theorem is applicable for Distributed Data Stores and comes into effect when Network Partition (P) happens. It says when (P) happens then the Distributed Data Store has to chose between Consitency (C) or Avaiability (A).\n\ni.e. when P happens then either it will be PA or PC. \n\nRDBMS used to be PC but with time they have started supporting PA as well. \n\nComing to Redis specifically, High Availability is more than being Partition Tolerance. Redis has Master Slave architecture and if a Master fails then Redis Sentinels promote a Slave to be the new Master, making the entire solution highly available. And a master can fail (or become unavailable) for number of reasons (e.g. out of memory), it isn't necessarily due to a Network Partition. \n\nThen comes the case of Network Partition (P), and if (P) happens then Redis becomes unvailable in the minority partition. 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. \n\nYou can read more about Redis High Availability here. Refer para titled \"Consistency under partitions\" for details around Partitioning. \n\nRedis is also called eventually consistent because when (P) happens, the minority parition is still available for a few seconds and any writes done during that period on the minority parition will eventually get discarded. ",
2019-12-29T06:35:24
yy