What are the reasons behind the schema of the ASP.NET Membership DB schema?
The following questions are about the DB set up with aspnet_regsql.exe (for .NET 4):
- Why is the username stored in aspnet_Users both in original form and in lowercase? Why not lowercase all the time?
- Why are Users and UsersMembership two distinct tabl开发者_StackOverflow中文版es? Is this just because we can have different membership/application or is some best practice?
- Should data like "IsApproved" be stored in DB like a column? For me it seems like a temporary column that, once approved, could be removed. So why not store it a table with key/value pairs (something like "ExtendedpProperties). Similar for other columns like "Comment" or "LastLockoutDate".
- What is the purpose of "LastUpdatedDate" in "aspnet_PersonalizationPerUser"?
- Why are there two columns for Value in aspnet_Profile?
Is there something wrong in that DB? Do you think that it should have been designed in another way? Please provide arguments.
Thanks!
- The idea of any calculated column is to save cycles on doing those calculations during querying. Most especially during large queries. The other thought is one which you had in indexing those columns. Again, this is done to save cycles.
- The membership table holds information related to the MembershipProvider API interface. The users table stores usernames and user ids, which are referenced from many providers. The aspnetdb system is very modular and each piece can be customized through the various providers. The tables need to be separated so each interface can be rewritten, redirected, etc.
- Where do you want to store this information else?
- Maybe you want to know when the user or the application last changed WebParts
- PropertyNames holds a string value containing information about the profile property values present in the PropertyValuesString and PropertyValuesBinary fields. The string holds a colon-delimited list of items.
Looks like, you have been given an assignment , everything is there for a reason go through Asp.net Membership Documentation
精彩评论