Hacker News new | comments | show | ask | jobs | submit login
Ask HN: Best way to handle user profile data?
3 points by chrisblackwell 1553 days ago | hide | past | web | 2 comments | favorite
Almost every web application now allows you to setup a basic profile (Even Stack Exchange does). The question is how should you be storing the data in your database?

Should you just add more columns to your users database table, or should you setup another table called user_profiles that has a foreign key of user_id?

I think it depends on: a) potential number of users you are going to have in your table b) number of times you use that data in joins etc.

I think in the majority of cases you can have that data in one table (although you will most likely require normalization for some other types of info - address, contacts, etc.). I would only think about moving some columns out of users table if they are too heavy and I have many millions of users.

What do you mean by 'too heavy'? I'm not sure how moving the data to another table would help if you have a lot of users. I would use a user_profiles table if I wanted values to be localized (different values for different languages), but couldn't see a good reason otherwise.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact