I am wondering what the best practices are for organizing user data.
Should I store all user data per row in one table or should I be cutting it up into smaller chunks and using multiple tables related by primary key?
For example.
To start I would want to record personal info like name, occupation, location etc.
Eventually it would be nice to have the option to add usage history. As in how many and which surveys they filled out and which articles they commented on.
While typing this it makes sense to me to have a table for comments a table for username+password, a table for personal info and to keep adding tables as my needs grow…
Would like some confirmation though.
If there are going to be one-to-many relations then you should split it up, but for things that are one-to-one you shouldn’t. So if the user is going to have multiple addresses, phone numbers, history, friends, etc, then you would have an addresses table (or phone numbers, history, or friends tables) that is tied to the customer’s id.
For the username and password you wouldn’t need a separate table.