Announcement Announcement Module
No announcement yet.
Redis with read-only slaves Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Redis with read-only slaves

    I want to use Spring-Data redis to access a redis cluster with one master and a bunch of read-only slaves.

    Can i configure a redis template to support that or do i have to rely on jedis to do that? Does anybody have an example for this use-case?


  • #2
    There isn't anything specific to replication or partitioning in spring-data-redis. There has been some discussion on supporting ShardedJedisPool[1] but since the majority of supported drivers don't have partitioning logic, we haven't started working on an abstraction. Also, we've been holding off in favor of a server-provided partitioning strategy as in the upcoming Redis Cluster.

    As far as Jedis goes, it looks like the RoundRobinPool[2] is their solution for the master/slave setup you described, but it's not yet officially part of Jedis.

    Perhaps you could use an external load balancer to route reads to slaves or switch to twemproxy if you want to explore partitioning?

    [2] ("A note on Redis' master/slave distribution" section)