namespace bids

Matthew Glubb matt at zgroupplc.com
Thu Feb 2 11:15:15 UTC 2006


One possible method to use namespaces and be able to delete a whole  
namespace would be to amend the hashing routine that determines what  
memcached server to get / set keys from:

1. Hash the namespace to determine which host group to get or set from.
2. hash the key to determine which host in the host group to get or  
set from.

If you want to delete a namespace, just flush_all on the hosts in  
that host group.

Matt

On 2 Feb 2006, at 10:56, Erik Mogensen wrote:

> I would rather have the inexpensive (O(1)) option of clearing out a
> name-space of items by timestamp, as has been suggested several times
> earlier.  It is much less complex, and mirrors the existing flush_all.
>
> (1) You would add items (optionally to a name space).
>
> (2) flush_all simply sets "last_flush_all = now()"
>
> (3) flush_namespace would set "last_flush[namespace] = now()"
>
> (4) Normal retrieval would have the following logic:
>   if (timestamp_of_cached_item is older than the last_flush_all)  
> remove
> object and return null
>
> (5) Retrieval from a name space, same as (4) and then:
>   if (timestamp_of_cached_item is older than the last_flush 
> [namespace])
> remove object and return null
>
> Internally you would have a table of name spaces and their last flush
> (last_flush[])
>
> You have a little problem with cleaning up the last_flush[] table,  
> since
> you can't be sure that it's safe to remove *really old* entries,  
> and the
> table might grow.
> -- 
> -mogsie-



m a t t h e w   g l u b b

________________________________________________________________________
Z Group PLC

Tel: +44 (0) 8700 111 173
Fax: +44 (0) 8707 051 393
Txt: +44 (0) 7800 140 877
Web: <http://www.zgroupplc.com/>

PLEASE NOTE ZGROUP IS NOT LIABLE  FOR ANY DAMAGES,  MALFUNCTION, OR LOSS
OF DATA,  CAUSED AS A RESULT OF FOLLOWING  ANY  ADVICE  ENCLOSED IN THIS
EMAIL. ANY CHANGES SHOULD BE CARRIED OUT AT YOUR OWN RISK.

This  email  and  any  files  transmitted  with it are  confidential and
intended solely for the use of the individual or entity to whom they are
addressed.  The opinions  expressed in this mail are those of the author
and do not necessarily  represent the views of the company.  If you have
received this email in error please notify <service at zgroupplc.com>





More information about the memcached mailing list