In the Parse.com API reference for Swift on iOS, it is very clear when to use the different kinds of One-to-Many relationships, based on the expected size of the Many side.
But I find it less clear on what kind of Many-to-Many relationships to use when both sides could be very large.
In my case, I have a Charity
object that my Users
can make small (often one-dollar) contributions to--so each User
could conceivably make thousands of these contributions, and each Charity
could have thousands of Users
making contributions to it.
The Many-to-Many options listed for this kind of thing are Parse Relations, Join Tables, and Arrays, of which the docs explain:
- Arrays should be used when the relationship will reliably include under 100 references, which is very clear and helpful guidance that I should not use Arrays.
- The docs say Parse Relations could be used, for instance, to connect
Books
with multipleAuthors
andAuthors
with multipleBooks
--a situation in which a givenBook
is unlikely to have over 100Authors
, and only rarely will anAuthor
have over 100Books
--so it's unclear if this is appropriate when both sides could be very large, as in my case. - The docs say Join Tables should be used when extra metadata should be attached to each relationship, so for one thing, I don't at present have an explicit need for this, and for another, the docs don't seem to even mention anything about how or if it matters how large each side of the Many-to-Many relationship is.
In the absence of any other information, it looks like I should use Join Tables, but only because the docs don't imply that I shouldn't, and not for the reason the docs say I should.
Which seems like a flimsy rationale.
I would greatly appreciate any guidance anyone can give.