Regarding Memcache Usage

Mikael Johansson mikael at synd.info
Tue Aug 28 20:49:45 UTC 2007


Hi,

1) Consistent hashing can do this for you. At least to a high degree,
some keys may still land on other servers but they should be few.

2) Servers need not be added in the same order and you can add or remove
servers from the pool without causing most or all keys to be remapped to
other servers.

3) You don't, the client chooses a server based in its internal
transparent algorithm. If you really want to know, it might be possible
to emulate the hashing algorithm in PHP to determine which server would
be selected for a given key.

The next version of pecl/memcache will support consistent hashing
(there's working code in CVS), can't say when it'll be released though
and we're also waiting to see some sort of standardization on the
consistent hashing issue.

//Mikael

Ajinkya Nahar wrote:
> Hi,
> 
>  
> 
> I am working on a PHP – MySQL based application.
> 
>  
> 
> I want to use Memcache for caching purpose.
> 
>  
> 
> I have been reading about memcache for last two days.
> 
>  
> 
> However, I have following doubts about the PHP client library (memcache
> extension) –
> 
>  
> 
> 1)       How will we add or remove a particular memcache node without
> flushing all data?
> 
> 2)       How is consistent hashing better than the current hashing used
> in PHP library?
> 
> 3)       How can we come to know on which memcache node a particular key
> is stored?
> 
>  
> 
> Please let me know your suggestions/answers.
> 
>  
> 
> Regards,
> 
> Ajinkya
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://lists.danga.com/pipermail/memcached/attachments/20070828/4074c403/signature.pgp


More information about the memcached mailing list