How to filter the necessary and sufficient data for each mobile phone?
Indeed, the database of the server can be important to manage many customers but not on the phones which must only contain useful data for the customer having the phone.
Use import filter to specify the subset of server side documents that you want imported by Sync Gateway and processed for sync to mobile clients. Only documents imported by Sync Gateway will be available for sync to the mobile clients. More on shared bucket access and import processing discussed here.
Leverage Sync Gateway channels to segregate data and enforce access control on a per user basis. If there are private documents associated with each user, then create a channel per user. If you have common documents shared across users, create a shared channel or just put documents in the public channel. In your sync gateway sync function, assign documents to channels based on suitable criteria.
But I can’t write user authentification for all the users of my mobile application.
Let me explain : my application have clients who sell products to customers.
So client have to see only their customers and their products. Also, they have in local dabase only them : for space issues and also security and privacy, etc…
Customers can have access to products but with less informations than clients, and also they should have on local database only necessary data.
My issue is that if I read right I should create authentification for all my application users.
Seems very strange.