Hello,
Trying to design an app here, and it’s not super clear to me the best way to design it using Realm.
Essentially - the app will have a bunch of accounts, which own items.
The complication arises when I add another feature into the mix – Groups. I’d like accounts to be able to be members/admins of groups - naturally an extension of Realm’s permissions.
For this, I was thinking of having a realm per user, and also per group. On top of this, I thought it would be best to have a global realm containing minimal information about user/group and links to each of their realms.
However, I’d also like Groups to have items themselves - specifically the items that users that are part of that group have added to the group. Not sure how to handle this relationship because items are fundamentally owned by the user - and thus located in the user’s realm. But, I must also be able to query for all items in a group - this seems inefficient if I store links to a user’s realm and have to fetch the item every time.
Is there a workaround for this type of relationship -? or a better way to design my realms in general?