Reputation: 12915
I've developed a couple small-mid scale web applications and I've made a (probably bad) habit of storing the user settings directly on the Users table - with one setting value per column. I did this because it was easy, and seemed like a good way to keep things simple.
Since every user will always have every setting, are there any reasons to separate the settings from the User table? Especially since different settings will be of different types?
Upvotes: 0
Views: 173
Reputation: 496
Based on my experience, it depends on the application, its architecture and the behavior you expect from the user table. it is a good practice to separate it over few table, because of database normalization and also the amount of redundant data you may have after a while.
Some users may have similar attributes and setting you can map them to same setting on second table so it significantly reduce redundant data. Also the database does not need to update a record with a lot of column for a simple setting modification instead it changes one or two values on second table.
Moreover, you have better management on your users if you decided to implement role based architecture in your web application.
I recommend to read more about database normalization.
http://www.studytonight.com/dbms/database-normalization.php
Upvotes: 2
Reputation: 5174
I don't see any reason why it would be bad, but it may vary depending on application.
Upvotes: 0