How do you get the size of a couchbase database

I feel that the question is simple yet I was surprised to not find any documentation nor information on it at all. I simply want to get or compute the size in bytes of a single couchbase database.

For example, I have a database that stores all the information of cars at a dealership. There are multiple documents within the database. I would like to figure out how to compute the non-compressed total size of the database. This include everything in the database (all documents, attachments, text, everything)

Ideally, using Swift 3.0. However, I can port over language to swift if anyone knows how to get the database size in any language.

My question is also posted on StackOverflow

Hi @seanmayes,

Based on your mention of Swift, I assume you’re asking about Couchbase Mobile database? If so, you may want to ask in the Mobile forum here: https://forums.couchbase.com/c/mobile

I’ll tag @jens, since he might know the answer (or how to find it).

It’s a directory in the filesystem, so you can just add up the file sizes.

1 Like

Thank you. I was hoping for a higher level function provided by couchbase for getting the database size. Seems like it would be a useful standard feature regardless of lite versus server flagship version. Based on the info provided, I implemented a file io approach. Posted on stackoverflow.