Redis › Clustering
What is the difference between a master node and a replica node within a Redis Cluster?
BeginnerAnswer
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 1Real-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.