Scaling with Redis Cluster
Learn how to scale Redis horizontally using Redis Cluster.
Redis Cluster
Because Redis is an in-memory database, the amount of data that can be accommodated depends on the RAM of the host machine. In order to scale beyond the capacity of a single server, we need to distribute the data across several Redis servers.
Redis Cluster helps by providing horizontal scalability. It ensures that data is automatically partitioned and distributed across the primary Redis nodes. This is also known as sharding. In Redis sharding implementation, every key is a part of a logical hash slot. A Redis Cluster is divided into 16,384 hash slots. To find out the key to hash slot mapping, a deterministic formula can be used, where we first calculate the CRC16 of the key and mod it by 16,384.
Note: A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and storage devices to detect accidental changes to data. ...