Reputation: 5840
I'm trying to find references how to configure and use Lettuce Redis client with client-side consistent hashing.
This approach for a sharding is implemented in ShardedJedis from Jedis client and described in the Redis partitioning documentation.
Short description of the approach: We have an environment with multiple independent Redis processes/nodes, without any server-based request routing using Redis Cluster or Sentinel, and a client decides where to store/search key by applying a hash function (key -> node_id) on the client side.
Does lettuce support this type of clustering/sharding out of the box? If yes, how it could be configured to use client hashing?
Upvotes: 4
Views: 1591
Reputation: 18129
There's no built-in support for sharding in Lettuce besides Redis Cluster.
Lettuce has support for fundamental Redis features. It supports Redis Standalone, Redis Cluster, Redis Sentinel and as of Version 4.x Master/Slave (which is a read routing layer on top of Redis Standalone) operating modes. All the other proposals and possibilities that could be built on top of Redis are not part of Lettuce.
Lettuce focuses on core Redis features to be a scalable and resilient client providing transport guarantees to your application. You could build that support yourself if you're interested in doing so.
Lettuce is kept extensible with the idea of allowing extensions to be built on top of AbstractRedisClient
(support for client facades and connection procedures), RedisChannelHandler
(the connection facade itself) and RedisChannelWriter
(an abstract writing facade that can be used for node-routing).
Upvotes: 5