Search:

Search all manuals
Search this manual
Manual
Couchbase Server Manual 1.8
Up
Couchbase Server Manual 1.8
Section Navigation
Chapter Navigation

Chapter 10. Developing Couchbase Clients

Table of Contents

10.1. REST/JSON
10.1.1. Parsing the JSON
10.1.2. Encoding the vBucketId into each request
10.1.3. Client Libraries and Rebalancing
10.1.4. Fast Forward Map
10.1.5. Redundancy & Availability

A couchbase client library implemention should be very similar to a memcached(binary protocol) client library implementation (and might even be an extension of some existing memcached binary-protocol client library), but just supports a different key hashing approach. Instead of using modulus or ketama/consistent hashing, the new hashing approach in couchbase is instead based around "vbuckets", which you can read up more about here

In the vBucket approach, to find a server to talk to for a given key, your client library should hash the key string into a vBucket-Id (a 16-bit integer). The default hash algorithm for this step is plain old CRC, masked by the required number of bits. The vBucket-Id is then used as an array index into a server lookup table, which is also called a vBucket-to-server map. Those two steps will allow your client library to find the right couchbase server given a key and a vBucket-to-server map. This extra level of indirection (where we have an explicit vBucket-to-server map) allows couchbase to easily control item data rebalancing, migration and replication.

blog comments powered by Disqus