It would be nice if you could tell dalli to choose a server to choose a server to store/fetch values based on a group-key (user_id, etc).
I'm interested in implementing this but unsure if what the best API would be.
We could add an option to every get/fetch command:
dalli.set('abc',123, :hash_by => user.id)
Or use a block:
I'm partial to the block format. It seems less repetitive and seems less invasive than making all the operations support a new parameter.
This would be trivial to support with the block format and a Thread local variable. Pull requests accepted.
I would think writing a memcached "sharding" layer on top of Dalli would be relatively straightforward. It's not something that should go into dalli proper though.