My web application is using redis for the main database. It’s very nice in performance. At this time, my database is too big and I want to add some new servers for storage. But I still stuck in the solution how to distribute in stable and easy to backup.
Everyone has any ideas?
Thanks a lot!
From what I understand there is no automatic way of doing this built into redis itself (and it’s hard to implementa generic way since it depends what your application will do with these data), you have to do this yourself (or in the driver like the ruby driver does).
I think your best bet is to put that logic in your application, without any knowledge of your application it is hard to say precisely but you may decide that the first part of your ids decide which redis server the key will be stored.
The ruby driver simply try to distribute the keys among the servers or takes the server index from the key name if formatted accordingly (something like “{server_id}mykey” after a quick glance at the code)
[Edit]
Possible solution:
– https://github.com/gmr/mredis