objectbox-dart icon indicating copy to clipboard operation
objectbox-dart copied to clipboard

[Sync] Filter data sent to a device

Open AfricanDev opened this issue 3 years ago • 4 comments

When syncing do we have an option to filter data that end up on a device for example on Couchbase we have what we call a channel where data can be filtered before synced on a device

AfricanDev avatar Jun 24 '21 04:06 AfricanDev

A question like this seems to be ignored! @vaind

richard457 avatar Jun 24 '21 16:06 richard457

For now, you can define on a type (class) level which objects you want to sync. This will get more dynamic with data spaces in the future.

greenrobot avatar Jun 24 '21 17:06 greenrobot

I have not used sync also, but I am going to suggest some design, It will be nice for sync to be added to the existing database without any breaking change to an existing database created without sync

SyncClient syncClient = Sync.client(
        store,
        #Note added channel here this is for the users allowed to access the object, 
        # of cause, each object would need to have this list of ids
       channels:[1,2,3], 
        'wss://127.0.0.1:9999', // wss for SSL, ws for unencrypted traffic
        SyncCredentials.none()
);
syncClient.start(); 

Then on an entity also define channels property and give it an array of Ids of users allowed to see the entity, this way I think it will be smooth and easy. let me know what you think of my proposal @greenrobot @vaind would love to know your opinion on this.

richard457 avatar Jun 26 '21 01:06 richard457

For now, you can define on a type (class) level which objects you want to sync. This will get more dynamic with data spaces in the future.

@greenrobot can you give an example of this? also I think the question is more of how data are propagated within devices not sync itself, for example I may want to sync data but still don't want all connected client to have access to same data more like data routing.

richard457 avatar Mar 09 '22 17:03 richard457