Databases 4 min read

Understanding Redis 3 Cluster: Key Concepts, Features, and Operations

Redis 3 now officially supports clustering, introducing hash slots and dynamic node management to simplify key distribution, scaling, and fault tolerance, allowing seamless read/write operations across multiple nodes without manual hashing, and offering features like online node addition, automatic slave monitoring, and performance‑aware key allocation.

Java High-Performance Architecture
Java High-Performance Architecture
Java High-Performance Architecture
Understanding Redis 3 Cluster: Key Concepts, Features, and Operations

Redis 3 officially supports clustering, addressing many inconveniences of building a Redis cluster.

Previous Cluster Issues

Redis can be imagined as a box holding N {key,value} pairs. When the box fills up, additional boxes are added, potentially many. Determining which box a new key belongs to and locating a key later requires a rule, such as using the hash value modulo the number of boxes.

This calculation was previously manual and cumbersome, especially when adding or removing Redis nodes.

Redis 3 Cluster Features

Operate keys as if on a single Redis instance without worrying about their node location.

Add or remove Redis nodes online without stopping the service.

Allocate different numbers of keys to nodes dynamically based on node performance.

Each node has a slave with automatic monitoring and failover.

Core Idea of Redis 3 Cluster

The cluster introduces the concept of hash slots . There are 16384 slots. Keys are not placed directly into Redis; they are first assigned to a slot, and slots are mapped to Redis nodes.

This can be visualized as placing keys into small boxes (slots) first, then placing those boxes into larger boxes (Redis nodes).

To locate a key, compute its hash to find the corresponding slot, then use the slot‑to‑node mapping to identify the node that holds the slot, and finally perform the operation on that node.

Operation Examples

Read/Write a Key

Add a Redis Node

Assume three existing nodes each handle roughly a third of the slots (16384/3 ≈ 5461). To add a new node, redistribute some slots from each existing node to the new one. The number of slots per node can vary based on node performance.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

databaseredisClusterHash Slot
Java High-Performance Architecture
Written by

Java High-Performance Architecture

Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.