Announcing Cache::Memcached::Managed

Elizabeth Mattijsen liz at dijkmat.nl
Sun Jul 3 15:28:46 PDT 2005


With some pride, I would like to announce an extended API for 
handling memcached data in Perl.

==================================================================
The uploaded file

     Cache-Memcached-Managed-0.07.tar.gz

has entered CPAN as

   file: $CPAN/authors/id/E/EL/ELIZABETH/Cache-Memcached-Managed-0.07.tar.gz
   size: 31839 bytes
    md5: 5412fa36de221301e953039c1dac3386

No action is required on your part
Request entered by: ELIZABETH (Elizabeth Mattijsen)
Request entered on: Sun, 03 Jul 2005 21:39:11 GMT
Request completed:  Sun, 03 Jul 2005 21:39:52 GMT
==================================================================

What does this add to the Cache::Memcached API?  In short:

- automatic key generation
The calling subroutine provides the key (by default).  Whenever the 
"get" and "set" operations occur in the same subroutine, you don't 
need to think up an identifying key that will have to be unique 
across the entire cache.

- ID refinement
An ID can be added to the (automatically) generated key (none is by 
default), allowing easy identification of similar data objects (e.g. 
the primary key of a Class::DBI object).  If necessary, a unique ID 
can be created automatically (useful when logging events).

- version management
The caller's package provides an identifying version (by default), 
allowing differently formatted data-structures caused by source code 
changes, to live seperately from each other in the cache.

- namespace support
A namespace identifier allows different realms to co-exist in the 
same cache (the uid by default).  This e.g. allows a group of 
developers to all use the same cache without interfering with each 
other.

- group management
A piece of cached data can be assigned to any number of groups. 
Cached data can be retrieved and removed by specifying the group to 
which the data belongs.  This can be used to selectively remove 
cached data that has been invalidated by a database change, or to 
obtain logged events of which the identification is not known (but 
the group name is).

- easy (default) expiration specification
A default expiration per Cache::Memcached::Managed object can be 
specified.  Expirations can be used by using mnemonics D, H, M, S, 
(e.g. '2D3H' would be 2 days and 3 hours).

- automatic fork() detection
Sockets are automatically reset in forked processes, no manual reset 
needed.  This allows the module to be used to access cached data 
during the server start phase in a mod_perl environment.

- magical increment
Counters are automagically created with incr() if they don't exist yet.

- instant invalidation
Support for the new "flush_all" memcached action to invalidate all 
data in a cache in one fell swoop.

- dead memcached server detection
An easy way to check whether all related memcached servers are still alive.

- starting/stopping memcached servers
Easy start / stop of indicated memcached servers, mainly intended for 
development and testing environments.

- extensive test-suite
An extensive test-suite is included (which is sadly lacking in the 
Cache::Memcached distribution).


Please let me know of any problems, suggestions or other remarks.  If 
the file is not yet in your local CPAN mirror, you can access it from 
my own repository of CPAN modules at http://www.liz.nl/CPAN .



Elizabeth Mattijsen


More information about the memcached mailing list