Redis Cluster 通过在多个 Redis 节点间进行分片来启用水平扩展 — 分布式数据集(和负载),使 Redis 能够处理超过单个服务器内存的数据和吞吐量。它通过哈希槽对数据进行分区,并提供内置高可用性。
通过哈希槽进行分片
Redis Cluster divides the keyspace into 16384 HASH SLOTS.
→ each key maps to a slot: slot = CRC16(key) mod 16384
→ slots are distributed across the cluster's primary nodes
→ each node owns a subset of slots (and thus a subset of the data)
→ This spreads data and load across nodes → scales memory and throughput horizontally.
数据通过在节点间进行分区(共 16384 个):每个键哈希到一个槽,槽分布在主节点上 — 因此每个节点持有部分数据,将容量扩展到超过单个服务器。
