Search code examples
database-designrealmrealm-mobile-platformrealm-js

Realm Database Full Sync - How to implement a global comment system


I need to implement a shared global realm where users can write new records and delete their previous ones but not delete other users records.

Example, a comment system.

I made it via object permission using query based sync but I cannot understand how to easily implement it via full-sync.

Has someone done it? How have you accomplished that? Thank you.


Solution

  • I was thinking of using a node js server that update a global database when something happens in the users databases.

    It works like this (tested, I need to understand how it scales.

    I use a listener for users databases, so users can insert rows in their database offline and when they go back online the node js server can replicate the data on the global database). So on the client I’ll have a property with the sync status (local, synched, deleted ) on the classes I need offline.