为什么Memcached不支持“多集"? [英] why does memcached not support "multi set"

查看:98
本文介绍了为什么Memcached不支持“多集"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释为什么内存缓存人员决定支持多获取而不支持多集合. 所谓多,是指涉及多个键的操作(请参见 http://code上的协议. google.com/p/memcached/wiki/NewCommands ).

Can anyone explain why memcached folks decided to support multi get but not multi set. By multi I mean operation involving more than one key (see protocol at http://code.google.com/p/memcached/wiki/NewCommands).

因此,您可以一次获得多个键(基本优势是通过减少往返行程即可节省标准费用),但是为什么不能获得批量套票呢?

So you can get multiple keys in one shot (basic advantage is the standard saving you get by doing less round trips) but why can not you get bulk sets?

我的理论是,这样做的目的是减少套数,而且也要单独进行(例如,对高速缓存进行读写).但是我仍然看不到多集与memcached的一般哲学到底有何冲突.

My theory is that it was meant to do less number of sets and that too individually (e.g. on a cache read and miss). But I still do not see how multi-set really conflicts with the general philosophy of memcached.

我在 http://code.google.com/上查看了客户端功能. p/memcached/wiki/NewCommonFeatures ,似乎某些客户端可能确实支持多集"(为什么只在二进制协议中?).我正在使用Java间谍memcached,顺便说一句.

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

推荐答案

文本协议不支持它,因为它表达起来非常非常复杂,没有客户会支持它,并且它所提供的信息很少无法通过文本协议完成操作.

It's not supported in the text protocol because it'd be very, very complicated to express, no clients would support it, and it would provide very little that you can't already do from the text protocol.

在二进制协议中受支持,因为它是二进制操作的平凡用例.

It's supported in the binary protocol because it's a trivial use case of binary operations.

spymemcached隐式支持它-只需做一堆设置,就会发生魔术:

spymemcached supports it implicitly -- just do a bunch of sets and magic happens:

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

这篇关于为什么Memcached不支持“多集"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆