Search code examples
realmrealm-mobile-platform

Can I use Realm DB if I need users to potentially have access to hundreds of other users' data?


I'm trying to determine if I can use Realm DB for an app I am building and I am stuck on access control.

In the Realm DB documentation it looks like the only way to do access control is through Realms themselves, by either granting or revoking access to an entire realm. The documentation also says to try and keep the number of concurrently open and syncing realms to about 12. I am trying to build an app with a social feed where users can "follow" each other, and you could potentially follow hundreds of different users. You see very little data, just their activity, so there is not much actual data going back and forth, but you should only have access to view that data if the other user lets you follow them. I am thinking of it being like each user having a "private" realm and a "shareable" realm that they can grant other people access to. Is there any way to do this with Realm DB that doesn't involve syncing hundreds of different realms?


Solution

  • At the moment, there is no other way than syncing hundreds of Realms.

    There will be another way in the future where you can use partial synchronization.

    https://realm.io/docs/java/latest/#partial-synchronization