Is it mandatory to use Sync_Gateway (for now) ?

We are developing an application with the following architecture:

Admin Web Portal --> CouchbaseServer
Mobile Device (using CouchBase Lite for iOS) --> Sync_Gateway --> CouchbaseServer

According to this post: https://groups.google.com/forum/#!searchin/mobile-couchbase/curl$20-X$20PUT$20admin_channels/mobile-couchbase/1QuAuoh6lbI/y2VQeq5G270J

I've found that my mobile app only recognizes data sent directly through Sync_Gateway to the Couchbase Server, so all data previously inserted into CouchbaseServer (configuration mostly: User Data, etc) using "external" tools (e.g. JAVA SDK) cannot be read by the mobile App.

How can I read the previous/existent data without having to re-enter it using Sync_Gateway?

Thanks in advance!

//Javier

2 Answers

« Back to question.

Hi there, that is a known previous limitation (see: http://docs.couchbase.com/sync-gateway/#limitations) that we are actively working on. While we do have some developers deploying so that both web and mobile clients go through Sync Gateway, what we look to recommend going forward is to utilize a methodology and feature we've dubbed "bucket shadowing": https://github.com/couchbase/sync_gateway/wiki/Bucket-Shadowing

EDIT: Looks like Jens beat me to it. Below is Jens response.

« Back to question.

Add a new database-level property "importDocs" to your config file, with value 'true'. Unversioned documents will be detected when the gateway starts up (before it starts serving to clients) and sync metadata will be added.

But don't write directly to the bucket after starting the sync gateway. After the import process, changes made to documents need to go through the gateway's APIs (either via replication from client apps, or via the REST API directly.)