0
0
Redisquery~5 mins

Hash slots distribution in Redis - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a hash slot in Redis Cluster?
A hash slot is one of 16,384 buckets used by Redis Cluster to distribute keys evenly across multiple nodes. Each key is assigned to a hash slot based on its hash value.
Click to reveal answer
beginner
How many hash slots does a Redis Cluster have by default?
A Redis Cluster has 16,384 hash slots by default. This fixed number helps evenly distribute keys across the cluster nodes.
Click to reveal answer
intermediate
How does Redis determine which hash slot a key belongs to?
Redis calculates a CRC16 checksum of the key and then takes the remainder when divided by 16,384. This remainder is the hash slot number for the key.
Click to reveal answer
intermediate
Why is hash slot distribution important in Redis Cluster?
Hash slot distribution ensures data is spread evenly across nodes, balancing load and enabling efficient scaling and failover in the cluster.
Click to reveal answer
advanced
What happens if a node in Redis Cluster fails regarding hash slots?
If a node fails, Redis Cluster reassigns the hash slots owned by that node to other nodes to keep the cluster operational and data accessible.
Click to reveal answer
How many hash slots are there in a Redis Cluster?
A1,024
B16,384
C65,536
D512
What method does Redis use to assign a key to a hash slot?
ARandom assignment
BMD5 hash mod 1,024
CSHA-1 hash mod 65,536
DCRC16 checksum mod 16,384
Why does Redis Cluster use hash slots?
ATo evenly distribute keys across nodes
BTo encrypt data
CTo compress keys
DTo store keys in a single node
What happens to hash slots if a Redis node fails?
AThey are deleted permanently
BThey remain unavailable
CThey are reassigned to other nodes
DThey are backed up automatically
Which of these is NOT true about Redis hash slots?
AHash slots encrypt the keys
BEach key belongs to exactly one hash slot
CThere are 16,384 hash slots
DHash slots help with cluster scaling
Explain how Redis Cluster uses hash slots to distribute keys across nodes.
Think about how Redis decides where to put each key in the cluster.
You got /5 concepts.
    Describe what happens to hash slots and data when a Redis Cluster node fails.
    Consider how Redis keeps the cluster working despite failures.
    You got /4 concepts.