Question about compound keys

Hey @kchan4,

I might be able to answer some of your questions :smile:

(1) The 20MB limit was put into place to keep performance efficient. As long as you’re staying under that limit you shouldn’t have to worry about Couchbase being able to crunch through it.

(2) To keep documents smaller you can split them up in the fashion that you mentioned. You might do something like this:

user::1001::productsviewed::01
user::1001::productsviewed::01::filechunk::01
user::1001::productsviewed::01::filechunk::02

Where productsviewed::01 is the particular product and could contain information about it and filechunk::01/02 is maybe image data to go with that particular product.

(3) I may need a bit more information on this one, but from what I’m interpreting is that you might have the following:

user::1001::post::1
user::1001::post::2
user::1001::post::3
user::1001::post::4
user::1001::post::5

Then you’re asking, what happens when you remove user::1001::post::3 right? In the concept of say a blog, this wouldn’t matter. Chances are you’d be using a View or N1QL query to list all posts in which case this deleted document would just be skipped.

Let me know if something doesn’t make sense or if I can help you further.

Best,