I’m building a new mobile application and intend to use Couchbase Server with Sync Gateway and Couchbase Lite to implement an offline/online data syncing model.
My question is about how much of the data is synced. Example:
The centralized database has data of 3 users: User1, User2 and User3. For simplicity lets say each user creates 100Mb of data that is syncronized in the server.
Data created by each user is unnaccesible for other users, and the queries that are made from the mobile client never include the data of other users.
If a user only queries and creates its own data, will he have in his device 300Mb of data or only his own 100Mb?
Replication can only access documents that are accessible to the user (i.e. assigned to channels that the user has access to.) So the answer would be 100MB.
A user needs to be authorized to access documents belonging to a specific channel. So if user1 and user2 want to share a document, you put that in a channel that is accessible to the both of them . You can learn more about it here Couchbase Capella for Mobile Developers