Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 2 years ago.
0

I always keep things simple to start with, so I wouldn't bother with separate tables - it's more to keep track of, and if you're then required to do joins, it's more expensive, and you have the added complexity of harder to read ORM queries, and it's more difficult to read the database raw.

Some other options:

  • Use the ENUM type in your User table columns, to store the properties
  • Have a single key/value table called profile_properties where you store all your seed values in one table
  • Use basic string columns, and store your attributes in a configuration file (less good for data integrity, but easier to edit and more flexible)
  • If you want to keep the Users table light, have a separate Profiles table, which link 1:1 to your Users table. You can then just read this when you need to, or do a very easy select from both tables.

Save the complex stuff for when you need it. I don't think a user profile warrants it!

Last updated 9 years ago.
0

Hi Dave, The user/profile is currently separate which links 1:1, however the are quite a lot of attributes for the profile, think dating website amount of attributes, with things for all kinds of stuff like hair color and such, what would be the best method with that amount of attributes

0

I'm no database expert it has to be said, so I Googled "best database design for dating profile" and got these results.

This was the first result, Database Design for Dating Site, which looks promising.

However, the second result is entitled Five Simple Database Design Errors You Should Avoid so read that too!

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

oisian oisian Joined 19 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.