This is a general multi-user, RealmCloud design question.
Suppose we have a multi-user app that stores notes for each user. Users have access to other users notes and can add to them, edit them or delete them.
User A creates a note and saves it to RealmCloud. User B is observing notes and sees User A added a note. User B opens the note and adds some data.
While User B is adding data, User A decides to delete that note. Now there’s a conflict between a note that is ‘in-use’ and it being deleted. What should happen is User A is notified that User B has the note ‘in-use’ and prevent deletion until it’s no longer in-use.
While a flag could be used, if User B d/c’s while working on the note, it will be forever locked.
With a number of other databases (SQL) there is record or row locking so that while User B has a note ‘in-use’, if User A tries to delete it, they will be notified the record/row is locked.
On the server side of things (SQL), if User B disconnects during the editing process, the server will unlock that record so work can continue.
Other databases don’t offer record locking however, the server can perform actions upon disconnect (Firebase) and ‘unlock’ records in those cases by means of setting/resetting an ‘in-use’ flag on a child node.
In the case of Realm, it doesn’t appear there’s any built-in functionality to handle record locking or tracking if an object is ‘in use’ or taking action upon a user disconnecting.
How are you handling multi-user workflow and environments like this?