Couch::Couchbase is a Perl client for Couchbase (http://www.couchbase.org).
The couchbase client is a smart, vbucket-aware client. What this means is that Couchbase::Client can tap into your Couchbase cluster, with the client needing to be able to access (initially) only a single entry point.
The module provides:
This is the simplest and most tested interface. The methods are self-explanatory. Additionally, the return type is complex and detailed, allowing error reporting for any unexpected conditions (something severely lacking in any Memcache client implementation).
Drop-in replacement for Cache::Memcached and Cache::Memcached::Fast.
I can't say it's 100% compatible yet, but the basic methods have been implemented. Internally it just wraps around the new interface
Provides the necessary functions and utilities needed to make a POE, IO::Async, etc. client for Couchbase.
Interface to the Java
This is a work in progress.
I will be focusing on installing and configuring
the C client library.
It is assumed you have a functional installation of the couchbase server somewhere.
go to http://www.couchbase.org
To use this module,
you should have installed
libvbucket (see the links on the side here http://www.couchbase.com/develop/c/current).
As of 01/28/2011,
you will need to download
libcouchbase itself from github (the current release versions contain bugs which may break this module).
libcouchbase itself depends on
so make sure to install that (and its development libraries) first.
Currently, I know of these dependencies:
libcouchbase depends on header files available from the
engine-pu branch of the
Note that actually building memcached itself is not required.
Your best bet would be to do something like this:
~$ mkdir couch ~$ git clone https://github.com/memcached/memcached.git -b engine-pu couch/memcached ~$ git clone https://github.com/couchbase/libcouchbase.git couch/libcouchbase #Get vbucket stuff: # I pick RPM, since that's what my target production platform is: ~$ wget http://packages.couchbase.com/clients/c/libvbucket1-220.127.116.11-1.x86_64.rpm ~$ rpm -ivh libvbucket1-18.104.22.168-1.x86_64.rpm ~$ wget http://packages.couchbase.com/clients/c/libvbucket-22.214.171.124.tar.gz ~$ cd couch; tar xf ../libvbucket-126.96.36.199.tar.gz ~$ ln -s libvbucket-188.8.131.52 libvbucket # Note for CentOS/RHEL 5 users, you will need to perform the autorun # to generate the 'configure' script on a newer platform, then copy it over # to your target platform ~$ cd couch/libcouchbase ~$ ./config/autorun.sh #make sure we know about the new memcached (and vbucket) headers: ~$ CPPFLAGS='-I../memcached/include -I../libvbucket/include' ./configure # (EL5: If configure complains about not finding libvbucket, try:) ~$ ln -s /usr/lib64/libvbucket.so.1 /usr/lib64/libvbucket.so ~$ make #optional, run some tests: ~$ make check
To build the perl client, you should edit the
PLCB_Config.pm file, and change the keys
COUCHBASE_LIBRARY_PATH to their appropriate locations.
If you were following the example above, your keys should look like this
COUCHBASE_INCLUDE_PATH => "~/couch/libcouchbase/include", COUCHBASE_LIBRARY_PATH => "~/couch/libcouchbase/.libs" #the '.libs' is an Autoconf thing, it seems.
$ perl Makefile.PL #you know the drill.. $ make test
There are some top-level scripts. Some have meaning to only the author, some might be useful.
Also, check out the runnable modules in the