As Jeff mentioned, each individual document or key/value pair cannot exceed 20 MB.
Our suggestion would be to split each document in smaller chunks. You’ll probably get the best results with documents of less than 5MB each.
Let’s say you’re creating an instant messaging platform and a particular conversation became extraordinarily long and took up several megabytes. You could use a combination of an atomic counter and key naming to track the chunks.
So, each of your chunks would have a key name something like this:
Where X is the number of the chunk: e.g. im_text::1, im_text::2, im_text::3 and so on.
You’d use Couchbase’s atomic counter data type to keep track of how many chunks you have in each conversation and also to provide you with the number of the next chunk. So, you might have something like:
Each time you want to add a new chunk, you’d send an increment to im_text::counter and it’d return the number to use. To find out how many chunks you have in the conversation, simply GET im_text::counter.
I hope that helps.