Announcement Announcement Module
Collapse
No announcement yet.
Redis with read-only slaves Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • 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?

    Greetings,
    Laures

  • #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?

    [1] https://jira.springsource.org/browse/DATAREDIS-71
    [2] https://github.com/xetorthio/jedis/wiki/AdvancedUsage ("A note on Redis' master/slave distribution" section)

    Comment

    Working...
    X