Benefits of a join table vs. array to express relations? (outside of SQL)
matcha_addict @ matcha_addict @lemy.lol Posts 59Comments 680Joined 2 yr. ago
matcha_addict @ matcha_addict @lemy.lol
Posts
59
Comments
680
Joined
2 yr. ago
Currently, I am storing entities in a JSON array / list. every element in this list corresponds to one instance of that entity.
I could express a many-to-many relationship as just another field in that entity that happens to be a list / array, or I can imitate a SQL join table by creating a separate JSON list to log an instance of that relation.
Are there any benefits to the second approach?