7 questions foundWhat is Redis Cluster, and what problem does it solve compared to running a single Redis instance?
Beginner Redis Cluster is a way to run Redis across multiple connected nodes that automatically share data between them, solving the problem of a single Redis instance being limited by one server's available memory and processing power, letting you scale out horizontally as your data and traffic grow.
-- A minimal cluster requires at least three master nodes
redis-cli --cluster create node1:6379 node2:6379 node3:6379 --cluster-replicas 0
Real-world example A growing application that outgrows a single Redis server's memory capacity moves to Redis Cluster, spreading its data across several servers that together can hold far more than any one machine alone.
Common follow-ups: What is the minimum number of nodes required to run a Redis Cluster?;Does Redis Cluster automatically handle failover if a node goes down?
Cluster Sharding & Hash Slots;Redis Sentinel & High Availability
What is the difference between a master node and a replica node within a Redis Cluster?
Beginner A master node owns a specific range of hash slots and handles both read and write operations for the keys in those slots, while a replica node keeps a synchronized copy of a specific master's data and can take over as the new master automatically if that master fails, providing both read scaling options and high availability.
-- Each master can have one or more replicas
redis-cli --cluster create node1:6379 node2:6379 node3:6379 replica1:6379 replica2:6379 replica3:6379 --cluster-replicas 1
Real-world example An online store runs a Redis Cluster with three masters and three replicas, one replica for each master, ensuring that if any single master fails, its replica can automatically take over without losing access to that portion of the data.
Common follow-ups: How many replicas per master is generally recommended for production?;Can a replica serve read requests while its master is still active?
Redis Replication;Redis Sentinel & High Availability
How does Redis Cluster automatically handle failover when a master node becomes unavailable?
Intermediate When enough nodes in the cluster agree that a specific master has become unreachable, one of that master's replicas is automatically promoted to become the new master, taking over responsibility for that master's hash slots, allowing the cluster to continue operating without manual intervention.
-- Failover happens automatically once a majority
-- of master nodes agree the original master is down
redis-cli cluster nodes
Real-world example A retail company's Redis Cluster automatically promotes a replica to master status within seconds after the original master node crashes during a hardware failure, keeping their shopping cart service running with minimal disruption.
Common follow-ups: How long does automatic failover typically take to complete?;What happens to write requests that were in progress during the failover?
Redis Sentinel & High Availability;Cluster Sharding & Hash Slots
What are the key limitations of Redis Cluster that developers should be aware of compared to a single instance Redis setup?
Intermediate Redis Cluster does not support multi key operations across keys that live on different nodes unless you use hash tags to force them onto the same slot, has limited support for selecting a specific numbered database since cluster mode only supports database zero, and requires cluster aware client libraries to properly route commands to the correct node.
-- This fails in cluster mode unless both keys share a hash tag
redis-cli mset key1 'a' key2 'b' -- error if on different nodes
Real-world example A team migrating from a single Redis instance to a cluster discovers several multi key operations in their code need to be redesigned using hash tags, since those keys were not guaranteed to live on the same node anymore.
Common follow-ups: How do you identify multi key operations in existing code before migrating to a cluster?;Why does Redis Cluster only support database zero?
Cluster Sharding & Hash Slots;Connection Pooling & Client Libraries
How would you design a Redis Cluster deployment to properly balance high availability, performance, and cost for a large scale production application?
Advanced You would choose a number of master nodes sufficient to spread your data and traffic appropriately, add at least one replica per master for failover protection, place replicas in different physical locations or availability zones than their masters to survive localized failures, and continuously monitor slot distribution and node health to catch imbalances or failures early.
-- Spread masters and their replicas across
-- different availability zones for resilience
redis-cli --cluster create ... --cluster-replicas 1
Real-world example A large financial services company deploys their Redis Cluster with masters and replicas spread across three different availability zones, ensuring the cluster survives an entire zone outage without losing access to any of their data.
Common follow-ups: What is the tradeoff between more replicas for safety versus infrastructure cost?;How do you test that a cluster deployment actually survives a simulated zone failure?
Redis Backup & Disaster Recovery;Redis Monitoring & Observability
What is a split brain scenario in the context of Redis Cluster, and how does the cluster protect against it?
Advanced A split brain scenario happens when a network partition causes part of the cluster to lose contact with the rest, potentially leading to two different nodes both believing they are the legitimate master for the same hash slots, and Redis Cluster protects against this by requiring a majority of master nodes to agree before promoting a replica, refusing to serve writes on a minority side of the partition.
-- A cluster requires a majority of masters to be reachable
-- to accept new writes, protecting data consistency
redis-cli cluster info
Real-world example A cluster experiencing a temporary network split between two data centers automatically stops accepting writes on the minority side, preventing conflicting data changes from happening independently on both sides of the partition.
Common follow-ups: What happens to write requests sent to the minority side during a network partition?;How do you configure the cluster's behavior for handling this kind of partition?
Redis Sentinel & High Availability;Redis Backup & Disaster Recovery
How do you monitor the overall health and status of a Redis Cluster to catch problems before they affect your application?
Intermediate You use the CLUSTER INFO command to check the cluster's overall state, CLUSTER NODES to see the status of each individual node, and dedicated monitoring tools that track metrics like memory usage, replication lag, and slot coverage across the entire cluster, setting up alerts for conditions like a node going down or slots not being fully covered.
redis-cli cluster info
redis-cli cluster nodes
Real-world example A database administrator sets up automated monitoring that alerts the team immediately if any node in their Redis Cluster becomes unreachable or if hash slot coverage becomes incomplete, catching issues before customers notice any problems.
Common follow-ups: What does it mean if cluster_state shows as fail rather than ok?;What third party tools are commonly used for comprehensive Redis Cluster monitoring?
Redis Monitoring & Observability;Cluster Sharding & Hash Slots