After doing my first “big” app with Bubble I am wondering about the best way to implement relation with things.
Let’s take an example with my app, I have one class of things called “Project” and another colled “ProjectStage”.
Obviously, one Project have many ProjectStages related to it (and only it, one ProjectStage is related to only one Project). ProjectStage contains informations such as startDate, endDate.
From here, there are 2 ways of implementing the data
- Solution 1 - Projects have a field ListStage which is a list of ProjectStage
- Solution 2 - ProjectStage have a field called Project which refer to a Project thing
Doing the project I was wondering of the most efficient way, and even sometimes changed the implementation to finally come back to the original (solution 2).
In other usecase (a messaging feature), I even implemented solution 1 and 2 at the same times, which requires a bit of attention to keep data integrity.
I wonder which is the best practice in terme of logic and in terms of performance.
Solution 1 advantage is that it is a bit more direct to access Projects list of stages (calling directly the thing instead of doing “Do a search for ProjectStages…”)
Solution 2 has other advantage. For exemple getting a list of projects regarding filters based on ProjectStage cant be more direct and server-side only while Solution 1 would require an “advanced” filter.
What is your experience?