How would i go about creating a relationship for photo albums that belong to either a user, event, group, network, page (I want to support x number of possible owners)? If possible even support multiple owners lateron.
One way is to have columns in the album table for these with one of them have a FK ID and rest be null. But problem is as i add more owner types i have to keep altering the table to add more columns
The other way is to have separate photo tables for each of these owner types.
None of these methods scale well. Any other methods to own photo albums for different owner types from one table that will scale (meaning have less joins and be easy to query as read performance is my #1 requirement?
Platform is MySQL/PHP.