Daniel Rench

Web application development : Servers : Networks : E-Mail : DNS : Databases : Programming for hire

previous : contact : linkedin : code : links : pictures : facebook : twitter : next

Hash::Server: a (mostly) memcached-compatible network interface to Perl hashes

You can download Hash::Server here until I get it on the CPAN (after a decade with Perl as my primary programming language I've finally signed up for a PAUSE account, so it could happen). Maybe you'll find this useful.

April 29, 2009 update: this code is now on github.



SYNOPSIS

        use Hash::Server ();
        use DB_File (); # for example
        tie(my %db, 'DB_File', './hash.db') or die $!;
        Hash::Server->new({ hash => \%db, localport => 11211 })->Bind();


DESCRIPTION

While memcached's original purpose was as a networked Memoize, it's also a simple way to distribute key/value hashes. But the official memcached (as the name implies) stores its data in memory, and is temporary. Given there are so many memcached clients for so many languages, it seemed a shame that there were no other ``backing stores'' available.

This module allows you to distribute any Perl hash structure you like with the memcached protocol. Typical use would probably involve a tied hash (as in the DB_File example above); if you want to serve a straight untied hash, you might as well use the real memcached, especially given the limitations of this module...


CAVEATS

This module is not a complete implementation of the memcached protocol.


SEE ALSO

http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt


AUTHOR

Daniel Rench, <citric@cubicone.tmetic.com>


COPYRIGHT AND LICENSE

Copyright (C) 2007 by Daniel Rench

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.

June 1 2007 : link