As it is best practice to group related keys that are frequently retrieved together (using multiGet) on a single server for optimum performance, I have a couple questions regarding the implicit mechanics employed by the client functions built for doing this.
I have seen two different approaches for serving what I assume is the same purpose using libmemcache (php-memcached specifically). The first and most obvious approach is to use getByKey/setByKey to map keys to servers and the second is to use the option OPT_PREFIX_KEY (there is a simple example posted in the php documentation under memcached::_construct), which according to the documentation is "used to create a 'domain' for your item keys". The caveat of the second approach is that it can only be set on a per-instance basis, which may or may not be a good thing.
So unless I am completely mistaken, and these two approaches don't actually serve the same purpose; is that any clear benefit for going with approach over the other?
And while I'm on this topic my other question would be: What are the implications, if any, to mapping keys to servers in a consistently hashed scenario? I'm assuming that if a node were to fail, the freeform key would simply be remapped to a new server without any issue..
Thanks!