soveran / ohm

Object-Hash Mapping for Redis

Home Page:http://ohm.keyvalue.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Redis Cluster support

ababich opened this issue · comments

Hello! Is there any Redis Cluster support planned or tried?
First of all I mean proper group operations handling via corresponding key(s) composition and preventing incorrect attempts

May be you have some posts with having this tried/tested with Ohm or some plans about this?

Thanks!

Hello @ababich, there are no plans for Redis Cluster support but it's something we could investigate in the future. At first sight it looks like a tough problem. We could embed key tags to make sure all the keys end up in the same node, but that kind of defeats the purpose of using Redis Cluster.

To my understanding only index-related keys should be touched
Also, LUA scripts should provide support for save actions

I have an idea that may work. I'll get back to you tomorrow after testing it a bit.

@ababich I've tried Ohm with Redis Cluster and it works after adding key tags. There's a branch called namespace with code that you can try, but you can also check the code online and make the changes by hand as there's nothing fancy going on. The idea is to change the name of a model, so that all keys generated include a given key tag. You can read more in the documentation for Ohm::Namespace and you can check the tests. Let me know if it works for you and maybe we can ship it.

I think it is more important to tag "relation", not model
I will scan all multi-keys operations for possible issues