Live data from Hacker News

Redis (consistent hashing based) sharding made easy

emre.github.io

1–10 of 24 posts

Re: Redis (consistent hashing based) sharding made easy

#5
post #3

The TCP server example shows a different protocol than the default redis protocol. (As I could not install it correctly I couldn't try it.) If this is the case current redis client libraries cannot be used.

Hello,

Redis accepts both a structured protocol, and a simple space-separated tokens protocol (called the inline protocol) that helps sysadmins to avoid a disaster just because they lack a proper redis-cli but are in need to run a Redis command ASAP. Perhaps this proxy is also supporting both forms.

You can do that with any modern enough Redis server:

    Escape character is '^]'.
    ping
    +PONG
    set foo bar
    +OK
    get foo
    $3
    bar

Re: Redis (consistent hashing based) sharding made easy

#6
post #3

The TCP server example shows a different protocol than the default redis protocol. (As I could not install it correctly I couldn't try it.) If this is the case current redis client libraries cannot be used.

What was the problem for installation?

I use redis-router in production as a library. some of my non-pythoneer friends asked to use it in PHP, so I made a little wrapper with gevent.

It's probably not compatible with current clients. Needs testing :)

Re: Redis (consistent hashing based) sharding made easy

#7

It seems like you've tried to support the set/store (sinterstore, sdiffstore, etc) methods across multiple instances in a non-atomic way - won't that lead to potential data loss?

Yes, these methods are dangerous to use.

I need a locking mechanism to do it safely but this will wait until I need it most likely.

Re: Redis (consistent hashing based) sharding made easy

#9
post #5
post #3

The TCP server example shows a different protocol than the default redis protocol. (As I could not install it correctly I couldn't try it.) If this is the case current redis client libraries cannot be used.

Hello, Redis accepts both a structured protocol, and a simple space-separated tokens protocol (called the inline protocol) that helps sysadmins to avoid a disaster just because they lack a proper redis-cli but are in need to run a Redis command ASAP. Perhaps this proxy is also supporting both forms. You can do that with any modern enough Redis server: Escape character is '^]'. ping +PONG set foo bar +OK get foo $3 ba…

I know of that simple protocol. But the responses in the example telnet session on that side return "True" and "13" where it should be "+OK" and ":13" with the redis protocol.

Re: Redis (consistent hashing based) sharding made easy

#10
post #5
post #3

The TCP server example shows a different protocol than the default redis protocol. (As I could not install it correctly I couldn't try it.) If this is the case current redis client libraries cannot be used.

Hello, Redis accepts both a structured protocol, and a simple space-separated tokens protocol (called the inline protocol) that helps sysadmins to avoid a disaster just because they lack a proper redis-cli but are in need to run a Redis command ASAP. Perhaps this proxy is also supporting both forms. You can do that with any modern enough Redis server: Escape character is '^]'. ping +PONG set foo bar +OK get foo $3 ba…

It doesn't support like this. It seems easy to implement it like that though. I will do it when I have free time.
Post reply on HN