2.0 DB 21 and sync gateway - replicating shared data between all users

I am working on how to structure a current application of ours to interface with couchbase. Basically we have project related data that will need to be available for everyone (master data set) and a transactional data set that users submit details related to the master set.

This is more of a theory question. So instead of using a specific sync function, would it be bad to use a generic account to create all the master project documents? Then in iOS app we would set replication for the master data bucket to pull only. All application installations would have the generic account used for replication, while their own user account would be required for syncing with the transactional data bucket. Would this be a bad design?


One of the goals of the Sync Gateway / sync function is data routing and authorization. So I don’t see the need to separate document types into separate buckets based on access control rules especially since the documents are related .
In other words, you should be able to assign the generic documents to a public channel that can be pulled by all users and you can have user specific docs in user specific channels

For this, you can set up two replicators in your client. One for pull replication of generic documents from public channel and a second pull/pull replicator for specific channels associated with the user. you can associate the replicator with user credentials to ensure that that only authorized users have access to the documents in the channel.

1 Like

oh ok, that makes more sense. Thank you for your response :smile: