My app functions kind of like Twitter. A User would follow Profiles which have Posts. A user doesn't have posts, profiles do.
The User and the Profiles are in a Many to Many relationship (so with a pivot table).
I want to show a timeline with all posts uploaded by the profiles which are followed by the logged in user.
There's two ways this could be done:
The second means there will be one query less (profiles won't be fetched) but it also means another pivot table will have to be added. The first option also feels a lot cleaner.
Which option would you choose?