简体   繁体   中英

CouchDB - PouchDB sync works but first change is very slow

In short my problem is that when updating PouchDB the sync to CouchDB happens after 5-15 minutes. After the first change has been sync'ed the following changes sync instantly as expected. The PouchDB is an AngularJS/Cordova-based app that currently only runs on Android. When logging into the app a range of PouchDB's are created and replicated from CouchDB, this works as expected. Afterwards a two-way continous synchronization is set up.

This setup runs in both a test and a production system, fortunately it works in production. I have compared settings for the CouchDB on both test and production and they are identical, so is the replication database. The only difference being my DNS-record being preceeded by test on the testsytem (eg http://testmydbserver.mydomain.dk ).

My frustration is growing, but after many hours of searching for an answer I feel I have reached the limit of my capabilities. My final conclusion so far is that the Pouch-instance does in fact post the new revision number, but seems to ignore the missing reply.

Have anyone had similar problems and found a solution? Or does anyone have an idea as to which direction I could continue, after having inspected code, restarted anything and analyzed network traffic for hours?

My guess is that somehow checkpoints are not being written, so that when you sync from local to remote, it is starting from scratch rather than starting from the last checkpoint.

Can you check to see if there are any PUT operations to _local/xxx in the network tab, which are checkpoint documents?

Also if you could provide a live test case, that would be very helpful. If you sync a ton of documents from server to client, then change on document locally, then sync from client to server, it should not take 5 minutes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM