Sync gateway taking 30 seconds to compute changes_view?

  1. Thanks, we might try that on a dev environment first since upgrading the server itself could have other repercussions.

  2. I’ll ask out app team why we delete all their data, but when a user logs out generally that means they want to switch to someone else using the device so you don’t want the old user’s data on their anymore. In general when someone logs out of an application it’s a best practice to clear their data so that someone else can’t access it without permission.

  3. It’s to improve synchronization performance by ignoring older documents. If we synced all their data for all time then for group owners it could be so much data that the sync takes hours, and the app may crash trying to index the data once it’s loaded. Currently group owners cannot log into the app because of this, which is why we wanted to introduce time based syncing. As time goes on users are going to be generating more and more data too, so if a long time user logged out and then logged back in it would be a problem.

As a possible solution is there a way to sync some documents, then pull the rest of the data as JSON documents from our server’s API, and still be able to store the pulled data in the couchbase lite db? Basically can we store existing documents in the local couchbase lite db correctly so long as we specify the id and rev fields in the JSON document? That way we could bypass sync gateway, keep user channels to just a couple, and have the power of our own filtering logic. Or if we just sent the ids of the documents to pull to the app, could it retrieve a list of specified documents through couchbase lite ok?