ohm icon indicating copy to clipboard operation
ohm copied to clipboard

Redis Cluster support

Open ababich opened this issue 9 years ago • 5 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!

ababich avatar Sep 21 '16 07:09 ababich

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.

soveran avatar Sep 28 '16 07:09 soveran

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

ababich avatar Oct 04 '16 11:10 ababich

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

soveran avatar Oct 04 '16 17:10 soveran

@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.

soveran avatar Oct 11 '16 08:10 soveran

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

ababich avatar Oct 11 '16 10:10 ababich