Database size on mobile


#1

I have an app that requires pulling a big load of documents from a Sync Gateway the first time it launches. When the replication is finished, the database can weight up to 50 mb, maybe more in the future. I’d like to know if there is a way to calculate how big a database will be after a replication.

I’m using Couchbase lite 1.4 on android.


#2

it all depends on how frequent are changes how many revisions we are having also when and how we run compaction.

Beware that when you run compaction on local and there is no auto compaction in android CBL 1.4.1, So when we run compaction the WAL file will be almost equal to the size of sql lite file, until we do one transaction for it.

So the best way we have found is to do database.compact and then save a document with a channel which no body listens having information when the compaction did run on this particular device.

The size for 1.4.1 also depend on the number of views and data you will have in them.

Without compaction and information of how many revision you want to keep it is very hard to tell how much data size you will have.

You can create some documents on the couch base server equal to the amount of documents you will have using sgload and gateload tool and then sync that to local and see how much size you get.


Do note these tools are used for load testing.


Limit total storage per user