r/DatabaseHelp • u/EschersEnigma • Jul 27 '15
Best way to implement persistent user data (settings)
I'm currently creating a web application using ASP.NET 4.5 MVC with MySQL backing my models.
Upon first login (and whenever they want to afterwards), the user enters their persistent information required for the web app (name, DoB, address, etc.)
There will be a couple to a few dozen settings which are required, and I've heard that best practice dictates that even going past as few as 10 columns in a table calls for reevaluation of your paradigm.
Let's say theorietically that I could break the settings down into different types. Would there be any performance/organization/usability/etc. benefit from creating different tables for each different section?
Follow up question: should persistent user data be stored in the same table as your table of users, or should Settings have its own table?
Thank you!
2
u/muchargh Aug 04 '15
Wow, it's dead around here.
To answer your question (better late than never?), the number of columns is (mostly irrelevant) if the data is properly modeled.
So, if your user table is truly 5NF there isn't much reason to worry about the number of columns except in certain circumstances, such as:
As always, if a property can only assume a set number of values, that property requires a foreign key constraint.