Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 432945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:07:30+00:00 2026-05-12T20:07:30+00:00

Trying to figure out the best way to set up collection lists for users

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:07:30+00:00Added an answer on May 12, 2026 at 8:07 pm

    If I understand correctly a collection has precisely 1 owner?

    So:

    users: user_id, name
    
    cars: car_id, name
    
    collection_cars: collectioncar_id, collection_id, car_id
    
    collections: collection_id, user_id, name
    

    So for each collection you store which cars are in them in a seperate table. I don’t think 1 million rows will be such a big problem if you use indices correctly.
    I don’t think it’s a good idea in general to give up on a good database design because you’re scared of having many rows. Databases are designed to handle large datasets, so that’s what you can use them for. Secondly; if you store for each user which car they own, you will also have to store to which collection that car belongs, so you won’t gain anything.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to figure out the best way to normalize the following data set,
i'm trying to figure out the best way to spilt the following url string:
Making a piano/keyboard application and trying to figure out the best way to set
I'm trying to figure out the best way to set up my tables/model associations.
I'm trying to figure out the best way of doing the following: I have
I am trying to figure out the best way to set our new process
I'm trying to figure out what the best way would be to set up
Trying to figure out the best way to do this: Should I do something
I'm trying to figure out the best way to do this, but I'm getting
I'm trying to figure out the best way to store an ArrayList<HashMap<String, String>> item

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.