-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support "by masterkey" #53
Comments
This is a very interesting feature! Perhaps we could make a more intuitive API than to extend get/set and friends, as this breaks new ground. with mc.master_key("somekey"):
mc.set_multi(dict.fromkeys("abcdef", "hi"))
mc.get_multi("cbd") Is what I come up with spontaneously, but I don't think it'll be very nice - imagine what happens if the with block code calls into Much rather then that the |
I think the proxy object would work well for our use-case. We are big user of multi-gets, and estimate we could save a lot of network traffic (and gain considerable performance), by hashing on a higher level. Something like the following could be an option: with mc.master_key("somekey") as mastered_mc:
mastered_mc.get_multi(....) |
... and thanks for a great library, we use it with big satisfaction. |
Hm, definitely needs a better name. There needs to be a logical name for the identifier, also what happens in this scenario: with mc.master_key("a") as mmc:
with mmc.master_key("b") as mmmc:
# use mmmc Edit: the logical thing would be for it to be equivalent to... with mc.master_key("ab") as mmc:
# use mmc |
It would be great if pylibmc could support the libmemcached functionality of hashing by master key instead of the actual key value. This allows to group related keys on the same memcached server, and avoid hitting many servers when getting or setting multiple values (get_multi, set_multi).
The text was updated successfully, but these errors were encountered: