document keys spread/choice
Wed, 08/22/2012 - 02:38
Hi,
I would like to know if there are any best practices related to choosing the keys of documents stored in a couchbase cluster.
Is there a possibility to make the cluster unbalanced (as an example because many keys fall in the same section of the ring)?
In general what are the recommendations in order to pick a key schema that works well with couchbase, are there any differences regarding write heavy vs. read heavy scenarios connected with key choices?
Thanks,
Paolo
Generally speaking your key design should support your use in application logic, for instance, more easily recognizable patterns for your own development:
Users
u::10001
u::92039
etc.
Products
p::28282
etc.
The hashing of keys is pretty uniform across cluster so generally stays very distributed. We currently don't provide any way to group keys and specify node locations. There shouldn't be any issues with write or read heavy scenarios in this scenario, the entire cluster is designed for heavy read/write loads. We have considered some options for grouping related items but it's not currently in the immediate pipeline.
@scalabl3
Technical Evangelist
Couchbase Inc.