Redis Sharding and Replication

326 views
Skip to first unread message

Yair Ogen

unread,
Jul 20, 2011, 3:35:17 AM7/20/11
to redi...@googlegroups.com
Hi,

I'm a newbie. Assume I want to use 2 redis servers, shardnig the data using Jedis. Is it only a matter of starting 2 Redis servers and having the Jedis pool write to both of them?

What about replication? If I need a 4 node cluster where 2 nodes are sharded and each shard replicated to another node. How do i do that?

Thanks,

Yair

Didier Spezia

unread,
Jul 20, 2011, 4:30:58 AM7/20/11
to Redis DB
Hi,

yes, sharding is supported on client-side. So your Jedis clients
should write to both Redis instances.

Replication however, is handled on server-side, so your Jedis
clients should still write to only two Redis instances at a given
point in time, and you need to configure master/slave
replication for each of them.

More information here:
http://redis.io/topics/replication
http://redis.io/topics/admin
and have a look at the comments in the Redis config file.

This post from Jeremy Zawodny may also help:
http://blog.zawodny.com/2011/02/26/redis-sharding-at-craigslist/

Please note that automatic failover is not directly supported
by Redis or its clients. Failover automation is not a trivial
problem.

Regards,
Didier.

Yair Ogen

unread,
Jul 20, 2011, 4:37:01 AM7/20/11
to redi...@googlegroups.com
Thank you very much. I'll carefully read the links you gave me.

How does one utilize replication without Failover being handled out of the box?

Regards,

Yair

emre yılmaz

unread,
Jul 20, 2011, 8:34:39 AM7/20/11
to redi...@googlegroups.com


2011/7/20 Yair Ogen <yair...@gmail.com>
--

i implemented sharding based on keys with consistent hashing.

here is my experience: http://emreyilmaz.me/implementing-consistent-hashing-into-your-redis

--
web developer
http://www.emreyilmaz.me

Linus G Thiel

unread,
Jul 20, 2011, 8:39:39 AM7/20/11
to redi...@googlegroups.com
Tangentially related, Tumblr has created a sharding RESTful service to
run in front of Redis:

http://engineering.tumblr.com/post/7819252942/staircar-redis-powered-notifications

(I'm not suggesting you use this, I just thought it might be of interest!)

> --
> You received this message because you are subscribed to the Google Groups
> "Redis DB" group.
> To post to this group, send email to redi...@googlegroups.com.
> To unsubscribe from this group, send email to
> redis-db+u...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/redis-db?hl=en.
>

--
Linus G Thiel
Hansson & Larsson
http://hanssonlarsson.se/
+46 709 89 03 85

Reply all
Reply to author
Forward
0 new messages