Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET built in user profile vs. old style user class/tables

I am looking for guidance regarding the best practice around the use of the Profile feature in ASP.NET.

How do you decide what should be kept in the built-in user Profile, or if you should create your own database table and add a column for the desired fields? For example, a user has a zip code, should I save the zip code in my own table, or should I add it to the web.config xml profile and access it via the user profile ASP.NET mechanism?

The pros/cons I can think of right now are that since I don't know the profile very well (it is a bit of a Matrix right now), I probably can do whatever I want if I go the table route (e.g., SQL to get all the users in the same zip code as the current user). I don't know if I can do the same if I use the ASP.NET profile.

like image 711
csmba Avatar asked Aug 04 '08 23:08

csmba


2 Answers

Ive only built 2 applications that used the profile provider. Since then I have stayed away from using it. For both of the apps I used it to store information about the user such as their company name, address and phone number.

This worked fine until our client wanted to be able to find a user by one of these fields. Searching involved looping through every users profile and comparing the information to the search criteria. As the user base grew the search time became unacceptable to our client. The only solution was to create a table to store the users information. Search speed was increased immensely.

I would recommend storing this type of information in its own table.

like image 102
Chris Newman Avatar answered Oct 20 '22 13:10

Chris Newman


user profile is a nice clean framework for individual customization(AKA. Profile Properties). (e.g. iGoogle) the problem of it is its not designed for query and not ideal for data sharing to public user.(you still would be able to do it, with low performance)

so, if you want to enhance the customized user experience, user profile would be a good way to go. otherwise, use your own class and table would be a much better solution.

like image 38
D.J Avatar answered Oct 20 '22 13:10

D.J