MYSQL: User - profile details table setup - best practice

后端 未结 3 973
南方客
南方客 2021-01-30 03:27

Next to your normal user table \"user\"(user_id/user_email/user_pwd/etc), what is the best way to go to store profile information?

Would one just add fields to the user

3条回答
  •  一整个雨季
    2021-01-30 04:01

    You need way more than 3 tables. How will he store data like multiple emails, multiple addresses, multiple educational histories, multiple "looking for" relationships, etc. Each needs its own row assuming many values will be lookups like city, sex preference, school names, etc. so either normalize it fully or go the noSQL route, no point in hanging in the middle, you will lose the best of both worlds.

    you can duplicate rows but it wont be good. social networks do not live with 50,000 users. either you will be successful and have millions of users or you will crash and clsoe it because to run these you need $$$ which will only come if you have a solid user base. With only 50,000 users for life investors wont invest, ad revenues wont cover the cost and you will close it. So design it like you want to be the next facebook right from day one. Think big!

提交回复
热议问题