<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2></FONT> </DIV>
<DIV> </DIV><!-- Converted from text/rtf format -->
<P><SPAN lang=zh-cn><SPAN class=618554305-28092006><FONT color=#0000ff
size=2>Mingqi, Shao</FONT></SPAN></SPAN></P>
<DIV> </DIV><BR>
<DIV class=OutlookMessageHeader lang=zh-cn dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2><B>发件人:</B> memcached-bounces@lists.danga.com
[mailto:memcached-bounces@lists.danga.com] <B>代表 </B>Mingqi Shao<BR><B>发送时间:</B>
2006年9月27日 12:40<BR><B>收件人:</B> Steven Grimm<BR><B>抄送:</B>
memcached@lists.danga.com<BR><B>主题:</B> Re: Can I create multi hash
table?<BR></FONT><BR></DIV>
<DIV></DIV>Steven, thank you for the answer. I think I have comprehended.<BR>I
hava another question. I don't find more detail document about memcached, so I
want to know what is the difference of set and replace command? <BR>Can
you share some document of memcache with me? thanks. <BR><BR><BR>
<DIV><SPAN class=gmail_quote>在06-9-27,<B class=gmail_sendername>Steven Grimm</B>
<<A href="mailto:sgrimm@facebook.com">sgrimm@facebook.com</A>> 写道:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV text="#000000" bgcolor="#ffffff">You have a couple options. If flushing
all person data is a very infrequent operation, you can do a "flush_all"
command, which will flush the entire cache, including all your product data.
That's by far the most efficient (on the memcached side, anyway) but obviously
it means your application will have to repopulate the whole cache, not just
the person data.<BR><BR>Alternately, if you need to flush all your person data
often, you can add another prefix or suffix to your keys: a version number.
When you want to flush the person data, just increase the version number you
append to all your person keys. The old values will still be in the cache, but
you will never look them up and they will eventually fall out of the cache
because of the LRU algorithm.<BR><BR>There is no way to perform bulk
operations on a subset of the values in the cache.<BR><BR>If you tell us a
little more about why you want to flush your person data, one of us can
probably offer some alternate approaches. Assuming, that is, that one of the
two suggestions above isn't suitable for you.<BR><BR>-Steve<BR><BR><BR>Mingqi
Shao wrote:
<BLOCKQUOTE
cite=http://mid8e500b580609262048i5c42f895j7992734a306aa6a8@mail.gmail.com
type="cite"><SPAN class=q>In pre-example, if I want to remove all persion
data from memcached, what shoule I to?<BR>I don't will run a separate
memcached process for each object type.<BR>thanks.<BR><BR></SPAN>
<DIV><SPAN class=q><SPAN class=gmail_quote>2006/9/27, Steven Grimm < <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:sgrimm@facebook.com"
target=_blank>sgrimm@facebook.com</A>>:</SPAN> </SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">可以。You
can get the same effect by just putting a prefix in front of <SPAN
class=q><BR>the IDs. So instead of a key of "foo" for a product, you'd
use<BR>"product:foo". We do this very successfully with a large number
of<BR>different object types.<BR><BR>If you can't do that, then you can
also run multiple memcached instances <BR>and fetch different object types
from each instance. We actually do a<BR>bit of that as well; we modified
our client code to look at the key and<BR>choose from separate lists of
servers for certain object types.<BR>(Unfortunately due to some licensing
ambiguities in the code we <BR>modified, we can't release those
changes.)<BR><BR>-Steve<BR><BR><BR>邵明岐 wrote:<BR>> For example, I want
to cache person and product information in<BR>> memcached. Their key
both are a identify of string type. Can I create <BR>> separate hash
table for they in order to avoid a identify of a person<BR>> and a
product are equivalent?
thanks.<BR><BR></SPAN></BLOCKQUOTE></DIV><BR></BLOCKQUOTE><BR></DIV></BLOCKQUOTE></DIV><BR></BODY></HTML>