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

<p>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? </p>

<p>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 <em>Matrix</em> 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.</p>

[{'answer_id': 1687, 'author': 'Dan', 'author_id': 230, 'author_profile': 'https://Stackoverflow.com/users/230', 'pm_score': 0, 'selected': False, 'text': '<p>In my experience its best to keep an the info in the profile to a bare minimum, only put the essentials in there that are directly needed for authentication. Other information such as addresses should be saved in your own database by your own application logic, this approach is more extensible and maintainable.</p>\n'}, {'answer_id': 1688, 'author': 'Michael Stum', 'author_id': 91, 'author_profile': 'https://Stackoverflow.com/users/91', 'pm_score': 0, 'selected': False, 'text': '<p>I think that depends on how many fields you need. To my knowledge, Profiles are essentially a long string that gets split at the given field sizes, which means that they do not scale very well if you have many fields and users.</p>\n\n<p>On the other hand, they are built in, so it\'s an easy and standardized way, which means there is not a big learning curve and you can use it in future apps as well without needing to tweak it to a new table structure.</p>\n\n<p>Rolling your own thing allows you to put it in a properly normalized database, which drastically improves performance, but you have to write pretty much all the profile managing code yourself.</p>\n\n<p>Edit: Also, Profiles are not cached, so every access to a profile goes to the database first (it\'s then cached for that request, but the next request will get it from the database again)</p>\n\n<p>If you\'re thinking about writing your own thing, maybe a <a href="http://msdn.microsoft.com/en-us/library/0580x1f5(VS.80).aspx" rel="nofollow noreferrer">custom Profile Provider</a> gives you the best of both worlds - seamless integration, yet the custom stuff you want to do.</p>\n'}, {'answer_id': 3020, 'author': 'Chris Newman', 'author_id': 468, 'author_profile': 'https://Stackoverflow.com/users/468', 'pm_score': 5, 'selected': True, 'text': '<p>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. </p>\n\n<p>This worked fine until our client wanted to be able to find a user by one of these fields.\nSearching involved looping through <strong>every</strong> 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.</p>\n\n<p>I would recommend storing this type of information in its own table.</p>\n'}, {'answer_id': 1647215, 'author': 'D.J', 'author_id': 168231, 'author_profile': 'https://Stackoverflow.com/users/168231', 'pm_score': 1, 'selected': False, 'text': '<p>user profile is a nice clean framework for individual customization(AKA. Profile Properties). (e.g. iGoogle)\nthe 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)</p>\n\n<p>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.</p>\n'}, {'answer_id': 1853330, 'author': 'Simon_Weaver', 'author_id': 16940, 'author_profile': 'https://Stackoverflow.com/users/16940', 'pm_score': 0, 'selected': False, 'text': '<p>I think it is better off using it for supplementary data that is not critical to the user that is only normally important when that user is logging in anyway. Think data that would not break anything important if it was all wiped.</p>\n\n<p>of course thats personal preference but others have raised some other important issues.</p>\n\n<p>Also very useful considering it can be used for an unauthenticated user whose profile is maintained with an anonymous cookie.</p>\n'}]
['https://Stackoverflow.com/questions/1683', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/350/']