openresty / lua-resty-redis

Lua redis client driver for the ngx_lua based on the cosocket API
1.9k stars 448 forks source link

Cluster #43

Open misiek08 opened 10 years ago

misiek08 commented 10 years ago

Hi! Is it possible to implement cluster functionality to core of this library? I'm not sure if I am able to do it myself, I tried, but code looks bad and it fails sometimes.

agentzh commented 10 years ago

@misiek08 I don't have the time to look into this and I'll rely on contributions :)

misiek08 commented 10 years ago

So we need to wait, right? :)

agentzh commented 10 years ago

Yes. I have put this into my TODO list. This is indeed a good thing to have.

fengpeiyuan commented 10 years ago

come on misiek08 :100:

wbdu commented 9 years ago

come on

bjoe2k4 commented 9 years ago

Maybe i'm wrong, but doesn't redis have builtin clustering functionality since version 3.0? Can't we rely on that?

misiek08 commented 9 years ago

@bjoe2k4 yes it have, but client need to implement few responses from Redis to fully support cluster. Redis have built in only semi-routing which tells client where to ask for data if client connected to wrong node at first.

agentzh commented 9 years ago

Guys, there are two pull requests implementing cluster-related features on the client side. Have you checked them out? See

https://github.com/openresty/lua-resty-redis/pulls

misiek08 commented 9 years ago

I see only one is totally cluster-related but I don't understand a part of code there.... Looks like there are 2 hard-coded limits for cluster count (20) and nodes count in cluster (500). It looks like this pull is using one object for many cluster and I think that one "client" should be one cluster. About node count limit I think it should be done on dynamically sized array if possible.

Or Lua is better than I think and my comment it's useless :) I had half-year break in Lua and nginx-related development...

bungle commented 9 years ago

I will add this to here as a reminder that implementing a cluster support is not something that can be done ligthly, many questions needs to be answered, a lot of design decisions need to be made: https://github.com/xetorthio/jedis/issues/990#issuecomment-103393965

alu commented 9 years ago

+1

vkozubal commented 7 years ago

+1

spacewander commented 7 years ago

Actually there are some unofficial clients offer part of the redis-cluster support. For example, like this one: https://github.com/steve0511/resty-redis-cluster