Key restrictions in Couchbase

I found information about document restrictions in Couchbase: / thread / key-length - the maximum key length is 250 bytes. But could not find the official one.

  • Can someone confirm the maximum key length for a Couchbase document?

  • What are the other key restrictions and what are some good practices for them?

  • What about indexes (keys for map functions)?

My use case is that I want to store documents identified by URL. A direct solution is to specify documents by URL. Assuming the URLs are more than 250 bytes, I need to select a different key - for example, md5(url)and put the URL as an element of the document. Is this a good model for Couchbase?

+3
source share
2 answers

Yes, there is a byte limit of 250 bytes per keyword in Couchbase Server. Your idea of ​​URL hashing should work just fine.

The bytes that make up the key must also be legal utf-8 (you can store and retrieve non-string keys, but they will not participate in the full set of Couchbase features, such as browsing and cross-replicating data centers).

The key to reducing display in the format should be utf-8 and limited to 65 KB.

+2
source

Couchbase. , Couchbase , . Couchbase , - .

-2

All Articles