Large download time

We have an application which needs 40,000 documents to be shared between server and mobile, each document is not bigger than 1Kb.
The download time of 15,000 documents from server to mobile is 20 minutes, when downloading each document. 40,000 documents will be about 50 minutes.
Is there any way to decrease the downloading time?
Maybe setting up multiple threads use on the Android / Phonegap SDK?

We are using:

  1. Ubuntu 14.04
  2. Couchbase 3.0.3-1716 Enterprise Edition (build-1716)
  3. Sync gateway 1.1.0 Enterprise
  4. Android

We need a way to speed up synchronization process. Can you help?

What version of Couchbase Lite for Android?

We are using couchbase-lite-android 1.1.0

Hideki would be the best person to answer this as he’s put a lot of work into replication optimizations for Android … but he’s on vacation till the week after next.

I don’t think multiple threads will help, but I don’t work on the Android version so that’s just a guess.

In the meantime you could help diagnose this by using some sort of CPU profiling to find where the bottleneck is.

Hi @faguirre, are these documents user specific? If not, why don’t you bundle them with your application. You can use a pre-populated bucket in your app and sync only the new revisions. Let’s say you ship the app with 40000 documents and in one week you create 1000 more, the new clients will have to sync only these 1000


Hi @vladoatanasov, those documents are global to all clients. That is a good option to try, how can we extract or bundle the couchbase lite database? is there any link or documentation to use? do we have to bundle those documents manually?

I would appreciate a deeper insight.


Hi @faguirre,

Solution that @vladoatanasov suggested is good solution for static or semi-static contents. If you are using couchbase-lite-android, followings are information. If you are using Couchbase Lite PhoneGap plugin, I can not guarantee if this solution works.

Guide line for pre-built database


Sample codes from Unit Test:

@vladoatanasov Thank you for your comments


1 Like

Hi @faguirre, you can follow @hideki’s documents and also take a look at the small example we provided in github. We are using this technique for our app, we also have quite a lot of semi-static data, so shipping it with the binary helps a lot. This way your clients can start using the app immediately after the download and you don’t lose the flexibility of having control over the document revisions