couchbase --- membase drop-in replacement?

I saw somewhere on couchbase.com that couchbase can be a drop-in replacement for memcached.
also it has been said that both have the same on-the-wire protocol.

but right now I have written some code in couchbase, it uses the couchbase java api. I want to change to memcached, but the api for memcached is different: most importantly, it seems memcached does not have this "bucket" concept, while the couchbase client constructor takes a "bucket" param:
client = new CouchbaseClient(hosts, bucket, password);

similarly for the reverse direction, if I were to use a memcached client on top of a couchbase server, I wouldn't be able to supply the bucket name.....

Thanks
Yang

1 Answer

« Back to question.

Hello,

So yes, you can use Couchbase as a Memcached drop-in replacement, this means that if your application is using a Memcached client, you just need to point it to the cluster and it works. You can find information about this here : http://www.couchbase.com/memcached

So when you do that the Memcached Client is connected to Couchbase Cluster using Moxi that is responsible of communicating with the various nodes in the cluster.

But if you are using the CouchbaseClient API, in you case the Java SDK, it is different. The Java SDK, like other Couchbase client is not only using the Memcached protocol to communicate with the cluster, but it does a lot more such as dealing with the sharding of the data on the different nodes, stay aware of any change in the cluster topology but also provide API to deal with views and cluster management.

So you can replace your memcached by a Couchbase cluster without any change in your application. But if you have a Couchbase application (meaning you are using a Couchbase client) you cannot switch to a memcached one.

Does it makes sense?

Regards
Tug
@tgrall