Channels/Doc Routing When Creating Doc in Shadowed Bucket


#1

I have tried to search the docs, the mailing list, and the forum for what I think is a basic question, but can’t really find much of an answer, I am sure it has been asked, so my apologies for the dupe, I really just need some help finding a succinct answer, and even a reference to an existing thread is helpful.

How does sync gateway route docs that are created in the shadowed bucket? Further, given there is no authenticated user, I understand that it just sees all docs, but how can I assign a doc created in a bucket via Couchbase APIs that is shadowed via the Sync GW to specific channels in Sync GW/Mobile?

My set up works great when docs are created by the mobile devices and the sync function routes them/assigns them to channels and the processes accessing the shadowed bucket via Couchbase APIs can edit and update existing docs, but when the docs are created by the server process in the shadowed bucket, they don’t belong to any channels - how do I get around this? Thanks!


#2

Hi @basitmustafa let me see if I can get some clarification first.

When referring to the “shadowed bucket” typically I am thinking of it as the “couchbase bucket” versus the sacred bucket dedicated to Sync Gateway and configured in the .json config file, “sync_gateway bucket”.

These two buckets communicate with each other using a Couchbase protocol that performs duplication between these two buckets. Buckets that are created in the “couchbase bucket” are then cloned over the “sync_gateway bucket” with revision information, and the Sync Gateway is made aware of these newly created documents and will appropriately sync them. As you mentioned, you read the documentation but to be sure, this behavior is described here: http://developer.couchbase.com/mobile/develop/guides/sync-gateway/wcbs/bucket-shadowing/index.html

The second point, channel development and data routing, I would need some more information. Would you be able to pass along what your configuration looks like today to give us an understanding of why the documents originating from the “couchbase bucket” do not appear to be utilizing the channels?

Thank you!