Finding the size of the documents that are stored inside Couchbase server

Hi, I have two types of documents, JSON and BinaryDocument, that are being stored in the buckets. I am in need of evaluating the sizes of the documents that are stored inside the Couchbase server. That is, I don’t want to retrieve the documents through views, use stringify operation on JSON documents to find it’s length and I don’t want to use decodeBase64 operation on BinaryDocument to find it’s length. That gives me the decompressed file size.

In short, I want to know how much each document takes up space inside the server. Or at least, the average space taken by the JSON documents and the average space taken by the binary documents. This is to know how efficiently the Couchbase server compresses the documents while storing them inside.

Can someone please help me with this?

You can use the couch_dbdump command (/opt/couchbase/bin) to dump the couchstore files on disk - that will show you the “real” size and compressed size for each document.

Assuming your JSON and binary documents have predicable keys, you could then filter by the particular document types and see what numbers you want.

The command is to be used in the console? Can you please tell me how to use it. I am not familiarized with this.