You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spring Data Redis repository pattern can confine only index keys within a single Redis slot when operating in cluster mode. Entity keys can be distributed across multiple slots as per the cluster's default hash algorithm. Commands (such as SINTER and SUNION) can still be processed on the server side as all involved index keys map to the same slot. Distributing entity keys across multiple Redis slots in a cluster environment can reduce hot spots and improved scalability and performance.
sureshkmit
changed the title
[Spring Data Redis Repository Pattern] Pin Keyspaces to single slot only for index keys on cluster mode.
[Repository Pattern] Pin keyspaces to single slot only for index keys on cluster mode
Dec 18, 2024
If you would like us to spend some time helping you to diagnose the problem, please spend some time describing it. Right now, we struggle to understand what you want to achieve.
Our current implementation utilizes the repository pattern to cache millions of objects, with indexing enabled on specific attributes. By confining all keys to a single Redis slot, we're effectively centralizing all data within a single shard. This approach negates the benefits of Redis Cluster mode, as horizontal scaling across multiple shards is hindered. To leverage the full potential of Redis Cluster, the library should distribute the objects data across the cluster. I believe restricting index keys to a single slot is adequate.
Spring Data Redis repository pattern can confine only index keys within a single Redis slot when operating in cluster mode. Entity keys can be distributed across multiple slots as per the cluster's default hash algorithm. Commands (such as SINTER and SUNION) can still be processed on the server side as all involved index keys map to the same slot. Distributing entity keys across multiple Redis slots in a cluster environment can reduce hot spots and improved scalability and performance.
https://docs.spring.io/spring-data/redis/reference/redis/redis-repositories/cluster.html
Example
NOTE: Curly brace only on index keys.
The text was updated successfully, but these errors were encountered: