This page explains the two available modes for Memorystore for Valkey: Cluster Mode Enabled and Cluster Mode Disabled.
Cluster Mode Enabled: Cluster Mode Enabled supports the OSS Valkey cluster specification. It lets you partition your data across multiple shards and is useful for applications with high volume or velocity of data.
Cluster Mode Disabled: While in Cluster Mode Disabled, your instance isn't partitioned and is hosted on a single shard. You can use this mode if the volume of data and write throughput can be handled by a single node and you prefer to use the specific features that aren't available in Cluster Mode Enabled.
You can only select between Cluster Mode Enabled and Disabled when you create an instance. The server_mode
field in the output of the INFO command specifies the mode of the instance. After you create an instance with either Cluster Mode Enabled or Cluster Mode Disabled, you can't change the instance to the other mode. We recommend that you select Cluster Mode Enabled because this mode has better horizontal scaling characteristics.
Compare Cluster Mode Enabled and Cluster Mode Disabled
Feature | Cluster Mode Enabled | Cluster Mode Disabled |
---|---|---|
Horizontal scaling | 1 to 250 shards | Not supported (single shard only) |
Client support | Need a cluster-aware client to use the discovery endpoint | Use any Valkey or Redis client |
Multi-key commands | Supported only in a single keyslot | Supported across all keys within a database |
Maximum writable capacity | 14,500 GB | 58 GB |
Maximum databases per instance | 1 | 16 |
- You can increase or decrease the size of the instance only when you create it.
- You can have a maximum of two read replicas for the instance.
Which should I choose
When choosing between Cluster Mode Enabled and Cluster Mode Disabled, consider the following factors:
- Read and write throughput: If your write throughput is fulfilled by a single node and your read throughput is fulfilled by a maximum of two replicas, then use a Cluster Mode Disabled instance. If the read and write throughput requirements are high, then use a Cluster Mode Enabled instance because this type of instance can spread the load across different nodes.
Migrate from Memorystore for Redis: If you're using a Memorystore for Redis instance or a self-managed Redis instance, migrating to a Cluster Mode Disabled instance requires minimal changes as compared to migrating to a Cluster Mode Enabled instance. To migrate to a Cluster Mode Enabled instance, you must use a cluster aware client. Note: Memorystore for Valkey supports IAM authentication, which is a more secure authentication mechanism than the plain text authentication supported by Memorystore.
Multi-Key queries: A Cluster Mode Disabled instance supports multi-key operations (for example: MGET, MSET, EVAL) across keys within the database. For a Cluster Mode Enabled instance, multi-key operations are limited to a single hash slot.
Namespacing: With Cluster Mode Disabled, you can use multiple databases to bucket different kinds of data by using the
SELECT
command. This feature is useful if you want to use the same instance to power multiple applications or you might need to write different types of unrelated data. Multiple databases aren't supported by Cluster Mode Enabled. As a best practice, we recommend that you use multiple Valkey instances instead of multiple databases to ensure Quality of Service (QoS). Multiple databases on the same node provide logical isolation only.