I’ve recently been tasked with helping build a database for a dating website. I’m not new to the concept of databases at all, but I’ve run into a snag and have no idea how to proceed.
Note, I’ve tried searching for an answer but none of the results were very clear, which is why I’m asking this myself. Also, I am familiar to the concepts of 1 to 1, 1 to many, and many to many.
The users of the site will select what they’re looking for in a match and also give their own information to be matched upon.
Each user have 8 or 9 attributes. 3 of those attributes can have multiple values, the best way I can describe it is a group of check boxes that should be searchable (Example, a user can have a personality of outgoing, caring, and funny).
From what I’ve searched, the most popular answers were to:
- have a field for each check box in one table
- use a many to many relationship with each checked box being a record in the table
And, should I store what they are looking for, or should I leave that to just be a query the user will run on their own?
If I store what the user is looking for, they would be searching against the same 8 to 9 attributes, but all of them could contain multiple values (Example, you can only be one gender, but you might be looking for someone of either gender).
I would like for the ability to store what the user is seeking in a match, so that matches can be suggested automatically but I don’t know how to create this structure in an efficient format, if at all.
But I do not know which of these, or some third solution I am unaware of, would be the best fit for the website design. I had originally thought I could just make each attribute with multiple values, a BIT field, with each bit being a check box, but then I realized I do not know if I can query that information efficiently. If there is a way for me to do that, I would prefer that method, as long as there are no performance issues.
Everyone involved is hoping the website will become popular, so I’d like to know the best structure to serve a very large amount of users.
I apologize if there is an answer to my question already out there, none of the answers I found fit my situation and I don’t really know how to word my question for a search engine.
Thank you for any help you can give me.
You’re over thinking it. Put it all in a flat table for now. When you see the type/size of your data set you can always optimize it and write the sql so that it produces the same output.
Don’t optimize before you actually implement. This doesn’t sound like it will have billions of rows yet.