Re: SyncGateway "Bucket Shadowing" implementation questions

37 views
Skip to first unread message

Jens Alfke

unread,
Mar 6, 2014, 5:44:36 PM3/6/14
to mobile-c...@googlegroups.com

On Mar 6, 2014, at 10:45 AM, jalv...@txmglobal.com wrote:

I've found that my mobile app only recognizes data sent directly through Sync_Gateway to the Couchbase Server,
but it doesn´t "see" any previous data inserted to the CouchbaseServer.

Yup. This is a documented limitation. It’s possible to tell the gateway to import existing docs in the bucket when it starts up, but it’s not a very good solution because it still can’t detect later changes made to those docs.

According to the documentation I need to create a new "shadow" bucket on Couchbase Server and update my config.json to tell Sync_Gateway
to connect to existing bucket "Restaurant”.

Not quite. You tell sync gateway to use the new “Shadow_Restaurant” bucket, and to make it a shadow of the original “Restaurant” bucket that contains your Couchbase Server docs.

 1. Will I end up having two buckets, the original "Restaurant" and a new one "Shadow_Restaurant" on my Couchbase Server, right?

Yes.

 2. Will the Mobile device (via Sync_Gateway) read/write data from the new "Shadow_Restaurant" or from original "Restaurant" bucket?

“Shadow_Restaurant”.

 3. Will the Web Portal still writing to the original "Restaurant" bucket as it does today or it will write data to the new "Shadow_Restaurant" bucket?

It should write to the same bucket it does today, i.e. “Restaurant”.

 4. Using this approach, the Mobile device will be able to "see" the data from the original "Restaurant" bucket, right?

Yes. It’s a kind of special-purpose sync between the two buckets. Changes made to either one get propagated to the other.

—Jens
Reply all
Reply to author
Forward
0 new messages