Trying to figure out the best way to set up collection "lists" for users given the following data (pseudo code):
user table = id, name, email
cars table = id, make, model
user_cars table = user_id, car_id, rating
collections table = id, user_id, name
Facts:
Users can have many cars
Users can have many collections
Individual cars can be in many collections
The 2 options I see for allowing the user to have a list of collections are to either add a field to user_cars called collection_list
and make the contents of that field a comma-sep list of collections that the user owns, like: 1,30,400
or to add an additional table called collection_entries
which contains collection_id
, and car_id
, each pointing to their respective collections.id and cars.id. The possible problem I see with adding another table is that the number of rows will get huge in that table. eg: 10,000 users x 10 collections each x 100 cars per collection = 1 million rows.
Ideas?