I am currently in the process of migrating from CoreData to Realm (Sync). I could need some help with the partitioning strategy. My app has (currently) basically two types of data, either publicly available data (generated by me) or user-specific data (generated and only readable by the user). Therefore, I was planning to establish the partition value to be either
"public" for public data or
"user=<user_id>" for user-specific data.
The thing is, that I need to establish relationships between public and private objects (e.g. a public exercise can be part of a private workout routine), which, if I understand correctly, is not possible in Realm.
In addition, I need to query all objects of a type (private and public) to present the objects in a table (sorted alphabetically), which I find quite hard, since I would need to somehow combine the Realm Results.
To solve this issue I can imagine two strategies:
- Duplicate the “public” data to each for each user, so that the data is synced with the user`s partition, however, ending in overload of storage.
- Manage the relationships on the client side manually (e.g. by referencing only the object id), which I would like to avoid… (and which would only solve the relationship problem)
Do I understand the issue correctly? And if yes, can it be solved better?
Thanks in advance for the help!