Manual sharding In Couchbase Server

As Couchbase Server uses automatic key-based sharding to distribute data evenly in a cluster, and also provides automatic rebalancing and automatic replication.

Is there possibility of doing manual sharding in couchbase v7.X ?

For what purpose? The specific node where a document is stored should not be relevant.

@pjmanoj the short answer is no, as the SDKs will automatically distribute documents based on their keys. Usually this is the best pattern for most users, as it largely avoids hot-spotting and doesn’t require potentially-complex manual partitioning and repartitioning.

The longer answer is technically yes, but you’d need to either:
a) use the memcached binary protocol directly (e.g. write your own SDK) to do it, or
b) a given document key will always hash to the same vbucket id. vbuckets are our partitions and they are automatically distributed over the nodes, generally with redundant replicas of each vbucket on other nodes. If you can make two document keys hash to the same vbucket, you’ll know they’ll always exist together on the same node.

As @mreiche mentions, it would be good to know what you’re aiming to accomplish here. Perhaps we can offer some alternative solutions.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.