Many-to-many Relations

Welcome to Glide.

My approach to building changes all the time, but for the past few weeks I have decided to stop overthinking many-to-many relations. If there is one, I create a ThingsA↔︎ThingsB join table where I write row IDs of ThingsA and ThingsB, and that table is my relation. As soon as I create the table I create a single relation to the table of ThingsA and a single relation to the table of ThingsB, and back the other way.

I’m discovering aspects about join tables as I go along, and I’m sure I’m oblivious to many of their pitfalls, but the alternative is CSV values in cells and splitting them into arrays and then relating and that rigamarole. It works fine if there are few entities in the application, but it can get complicated quickly (at least to me). Personally I have trouble visualizing how data and tables relate in the first place, and join tables are making it slightly easier.

2 Likes