Keys are unique identifiers that you provide as a parameter when you perform any operation on data. The following applies to keys:
Keys are strings, typically enclosed by quotes for any given SDK.
No spaces are allowed in a key.
Separators and identifiers are allowed, such as underscore: 'person_93847'.
A key must be unique within a bucket; if you attempt to
store the same key in a bucket, it will either overwrite the
value or return an error in the case of
Maximum key size is 250 bytes. Couchbase Server stores all keys in RAM and does not remove these keys to free up space in RAM. Take this into consideration when you select keys and key length for your application.
This last point about key size is important if you consider the size of keys stored for tens or hundreds of millions of records. One hundred million keys which are 70 Bytes each plus meta data at 150 Bytes each will require about 45 GB of RAM for document meta data.