How big is the document you are trying to store? There is a 20MB max size for documents in Couchbase server. If you need to store bigger documents, then you’ll need to split the documents into multiple smaller documents and then store references to the keys in a “meta” document or equivalent.
I am trying to store list of objects may be it exceeds 20 MB but how can i expand this size to be 40 MB for-example ?
I need to know if each key to be stored can’t exceed 20 MB ? but the total keys can exceed till the max allowed memory ?
Thanks.
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:
im_text::X
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:
im_text::counter
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.