Why memcached does not support "multi set"

Can anyone explain why memcached people decided to support multi get, but not multi set. For multimedia, I mean an operation involving more than one key (see Protocol http://code.google.com/p/memcached/wiki/NewCommands ).

Thus, you can get several keys in one shot (the main advantage is the standard savings that you get by making fewer round trips), but why can't you get mass gains?

My theory is that it is designed for fewer sets and too individually (for example, to read and read the cache). But I still don’t see how multi-element really contradicts the general philosophy of memcached.

I looked at the client features of http://code.google.com/p/memcached/wiki/NewCommonFeatures and it seems that some clients potentially support "Multi-Set" (why only in the binary protocol?). I am using Java spy memcached, btw.

+3
source share
3 answers

It is not supported in the text protocol, because it would be very, very difficult to express, no client would support it, and it will provide very little that you can no longer do from the text protocol.

It is supported in the binary protocol because it is a trivial case of using binary operations.

spymemcached supports it implicitly - just a lot of sets and magic happen:

http://dustin.github.com/2009/09/23/spymemcached-optimizations.html

+1

memcache, , , . , , ( , ). , , .

+1

, , memcache.

, . , .

If sets alternate with different clients, it is most likely that for one key the latter wins, or at least close enough, until the cache is invalidated and a newer value is written.

As Jan mentions, there is no good reason to block reading from the cache, while several or many writes to the cache occur.

0
source

Source: https://habr.com/ru/post/1755819/


All Articles