We are using Couchbase Lite in a mobile app with upwards of 30,000 documents. Each document has a small attachment of 5-10Kb. The replication of the documents is triggered from an “in app purchase”. I am using a CBL view to count the number of documents replicated (i.e. items downloaded) and also storing the number of documents in that channel reported from Sync Gateway (total items). In this way I am able to provide visual feedback to the user of “download progress”.
There are a couple of issues that have arisen since the app was launched.
Our server is based in the UK. Users based in e.g. China or the US sometimes experience replication getting stuck, or slow progress. The obvious solution to this is to use DNS routing and have multiple servers in different geolocations.
On Android, during heavy pull replication the app slows almost to a halt. I think this is due to the repeated calls to the “count” view as well as the notification events.
One solution I am proposing is to separate the attachments out and download them separately, e.g. as a large zip file from a CDN.
My question is, is removing the attachments likely to improve replication time (as it will drastically reduce the data size)?