Concern on data size

Hi guys,

I’m building a system consisting of a Couchbase server and a mobile app which should sync with the server.

Right now, according to the stats available on Couchbase server, my bucket takes around 40MB of storage space. I guess it includes both data and indexes.

I was wondering if I have to expect the same storage space requirements on the mobile devices, or perhaps Couchbase Lite, which is based on SLite, is implemented in a way that will require less storage space.

Thanks

Kind regards

CBL tends to be lighter weight. Also, most use cases don’t end up replicating all the data to a mobile app. This all depends on what you’re doing, though, so you’ll have to see.

Storage footprint can be a consideration for how you model your data. If it seems like the database will be too big, you might spend some time thinking how you can rework you models to let you reduce size.

1 Like

In my case I’ll need to sync the whole database: all data need to be accessible to users.

Thank you for the advice.

Regardless, even with the whole data set, it will not be as big as it is on Server. Server has to store additional information besides the actual contents of the document. Mobile does too, but it’s not nearly as much and it is compressed into our binary format for storage of the body.

However I suppose the best way to find out is to try. Unfortunately our unofficial tool for doing this has fallen out of date but all you need is a desktop application that will set up a one shot replication against the admin port of sync gateway (Or a user with access to all channels on the public port) and wait for it to finish. After that you can find the actual database on the filesystem and inspect it. The underlying file format being SQLite means that you can trust that it will be very close to the same size on all platforms (depending on the filesystem and its block size, etc, etc, but no more deviance than probably 1 MB as a rough uninformed guess)

1 Like

You’d have to try it out. I’m not actually sure how Server measures the data size of a bucket, whether it includes metadata and such.

Couchbase Lite 2 databases will be somewhat smaller because internally we use a binary encoding that compresses most dictionary keys down to 1 or 2 bytes.

1 Like