Can keys of one namespace be distributed to multiple shards?

Skip to first unread message

Jitesh Sinha

Aug 22, 2021, 5:00:14 PMAug 22
to Redis DB

In my application, we have multiple keys under a single cahce namespace.
For example, namespace "customer-personal-data" contains multiple keys such as:-
customer-{customer phone number}-{customer session id}.
There can be thousands of keys under this namespace.
Is it possible to distribute this namespace across different shards on Redis so that one specific shard does not get overloaded?
What I mean is that, half of the keys of this namespace reside on one shard and half of the keys of the same namespace reside on another shard. Is this kind of configuration possible?


Greg Andrews

Aug 23, 2021, 6:00:16 AMAug 23
to Redis DB
The open source Redis server comes in sharded and non-sharded configurations.

The sharded Redis has the title "Redis Cluster" and has some sharding features built in.  The reasons for Redis Cluster having built-in sharding features are, as you mention, to spread the processing load among multiple Redis instances (and presumably multiple servers), and also to spread the RAM consumption among multiple Reds instances (and servers).

The non-sharded Redis, which you appear to be using, doesn't have built-in sharding features, but your clients can still distribute keys across multiple servers.  This documentation page (which uses the word "partitioning" rather than "sharding") discusses the topic:
Reply all
Reply to author
0 new messages