I am attempting my first iOS app and trying to think about the [best] options for the underlying data model.
I have an active golf competition, with an ObjectId value in all associated collections, named “compId”.
If I was showing the results of a Leaderboard collection, filtered upon compId
and sorted as needed, as each player is listed, you could tap a name to expand and show their individual Scores ( a different collection) on each hole, but obviously linked.
I had expected this type of flow / construct:
-
User logs in
-
User selects from available / open competitions - this sets the partition key, which would be an ObjectId
-
With a comp open, either add new scores (for himself or others) or view the Leaderboard
-
As iOS app, this Leaderboard would be a TableView
How do I approach this scenario?
-
Do I need to open multiple Realms, per collection?
-
If I only need to open 1, i.e. Leaderboard, can I still query into the other?
-
Would querying across Realms / collections, need extra Realm(s) to be opened?
-
Or is this terrible modelling…???
Leaderboard viewers are not going to look at / expand EVERY player’s scores, in fact it expect only a few players as they are looking at any time. Then return in 10 mins time. Or similar. To ensure the most efficient data usage, how do you query the Scores only when a player has been tapped?