Can keys of one namespace be distributed to multiple shards?

42 views
Skip to first unread message

Jitesh Sinha

unread,
Aug 22, 2021, 5:00:14 PM8/22/21
to Redis DB
Hello,

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?

Thanks
Jitesh

Greg Andrews

unread,
Aug 23, 2021, 6:00:16 AM8/23/21
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:  https://redis.io/topics/partitioning
Reply all
Reply to author
Forward
0 new messages