Fully managed and integrated with Google Cloud, Azure, and AWS.
Build the fastest, most reliable GenAI apps with our advanced vector database.
Self-managed software with enterprise-grade compliance and reliability.
Synchronize data in near-real time to make data fast—without writing code.
In-memory database for caching & streaming.
Redis Cloud uses clustering to manage very large databases (25 GB and larger). Here, you'll learn how to manage clustering and how to use hashing policies to control how data is managed.
Redis Cloud |
---|
For very large databases, Redis Cloud distributes database data to different cloud instances. For example:
When data grows beyond the RAM resources of a single server.
Multiple shards should be used when data grows to 25 GB (50 GB for Auto Tiering) to create multiple shards.
The operations performed against the database are CPU intensive enough to degrade performance.
Clustering distributes operational load, whether to instances on the same server or across multiple servers.
This distribution is called clustering because it manages the way data is distributed throughout the cluster of nodes that support the database.
A Redis Cloud cluster is a set of managed Redis processes and cloud instances, with each process managing a subset of the database keyspace. Clustering uses multiple cores and resources of multiple instances to overcome scaling challenges.
In a Redis Cloud cluster, the keyspace is partitioned into hash slots. At any given time a hash slot resides on and is managed by a single Redis server.
An instance that belongs to a cluster can manage multiple hash slots. This division of the key space, known as sharding, is achieved by hashing the key names, or parts of these (key hash tags), in order to obtain the hash slot in which a key should reside. Redis Cloud supports several hashing policies.
Even when using multiple Redis processes, the use of a Redis Enterprise Cloud cluster is nearly transparent to the application that uses it. The cluster is accessible via a single endpoint that automatically routes all operations to the relevant shards, without the complexity of a cluster-aware Redis client. This allows applications to benefit from using the cluster without performing any code changes, even if they were not designed to use it beforehand.
When creating or editing a Redis database on Redis Cloud, the system automatically calculates the number of shards needed based on the database memory limit and required throughput.
Operations on multiple keys in a sharded Redis Cloud cluster are supported, with the following limitations:
The hashing policy determines how data is distributed across multiple Redis processes of a database. It uses a hashing function to map keys to hash slots in these processes, ensuring an even distribution of data for optimal performance and scalability.
The hashing function uses the entire key name to calculate the hash slot, unless the key name contains a hash tag, represented by a {...}
pattern.
If the key contains a {...}
pattern, only the substring between {
and }
is hashed in order to obtain the hash slot.
You can use the {...}
pattern to direct related keys to the same hash slot, so that multi-key operations are supported on them. On the other hand, not using a hashtag in the key's name results in a (statistically) even distribution of keys across the keyspace's shards, which improves resource utilization. If your application does not perform multi-key operations, you don't need to construct key names with hashtags.
Redis Cloud offers 3 hashing policies, which differ in how hash tags are processed. These hashing policies are not always available.
For accounts created after March 31, 2025, Redis defaults to the Redis hashing policy when creating a new database. For all other accounts, Redis defaults to the standard hashing policy.
The Redis hashing policy is identical to the hashing policy used by Redis Community Edition. This policy is recommended for most users and you should select it if any of the following conditions apply:
The Standard hashing policy is mostly consistent with the Redis hashing policy, and will generate the same hash-slot calculation in the following cases:
However, this policy is less recommended and you should select it only if any of the following conditions apply:
In some cases, the Standard hashing policy behaves differently from the Redis hashing policy:
The custom hashing policy is not available for accounts created after March 31, 2025.
For all other accounts, this policy is not recommended and will be deprecated in the future. Select this option only if you are already using a custom hashing policy with your existing Redis Cloud databases.
A Redis Cloud cluster can be configured to use a custom hashing policy. A custom hashing policy is required when different keys need to be kept together on the same shard to allow multi-key operations. Redis Cloud's custom hashing policy is provided via a set of Perl Compatible Regular Expressions (PCRE) rules that describe the dataset's key name patterns.
To configure a custom hashing policy, enter regular expression (RegEx) rules that identify the substring in the key's name - hashtag - on which hashing will be done. The hashing tag is denoted in the RegEx by the use of the `tag` named subpattern. Different keys that have the same hashtag will be stored and managed in the same slot.
Once you enable the custom hashing policy, the Redis Cloud's default RegEx rules that implement the standard hashing policy are:
RegEx Rule | Description |
---|---|
.*{(?<tag>.*)}.* | Hashing is done on the substring between the curly braces. |
(?<tag>.*) | The entire key's name is used for hashing. |
You can modify existing rules, add new ones, delete rules, or change their order to suit your application's requirements.
If the Custom hashing policy is available, you can change the hashing policy between Standard and Custom after you create your database. However, hashing policy changes delete existing data
(using FLUSHDB
) before they're applied.
These changes include:
OSS Cluster API reduces access times and latency with near-linear scalability. The OSS Cluster API provides a simple mechanism for Redis clients to know the cluster topology.
Clients must first connect to the master node to get the cluster topology, and then they connect directly to the Redis proxy on each node that hosts a master shard.
The Cluster API is only supported on Redis Cloud Pro databases. You can enable it in the Performance section of the configuration screen.
After you select OSS Cluster API, you can select Use external endpoint if you want to use the external endpoint for the database. Selecting Use external endpoint will block the private endpoint for this database.
The Redis Cluster API is supported only when a database uses the standard hashing policy and does not use Search and Query or Time Series advanced capabilities.
Review Redis Cluster API architecture to determine if you should enable this feature for your database.