This probably isn’t entirely correct since I am just looking at the output (e.g. the database rows) to determine this. For each object in profile (i.e. Users), there is a single row in the aspnet_Profile table. This table is made up like so:
CREATE TABLE [aspnet_Profile] ( [UserId] [uniqueidentifier] NOT NULL, [PropertyNames] [ntext] NOT NULL , [PropertyValuesString] [ntext] NOT NULL , [PropertyValuesBinary] [image] NOT NULL , [LastUpdatedDate] [datetime] NOT NULL )
The three middle columns are used to store the properties and their values. PropertyNames stores a list of properties with hints on how to retrieve it from the String or Binary column. For example:
IsClient:S:0:4:Parent:B:0:-1:LogoUrl:S:4:39:Expired:B:0:-1:Row:B:0:-1:CssUrl:S:43:28:Services:S:71:239:
Each section of this string is the metadata about the property:
As you would expect, the string field may be a mix of XML serialized data and string data. For example, the string field here is stored like so:
Truehttp://wilderminds.blob.core.windows.net/img/adoguylogo.gifhttp://wildermuth.com/adoguy.css <?xml version="1.0" encoding="utf-16"?> <ArrayOfString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <string>Cell Manager</string> <string>Cell Manager</string> </ArrayOfString>
You’ll notice that the first four characters are the word “True” which corresponds to the PropertyNames “IsClient:S:0:4:”. Likewise I have a property called Services which is the XML Serialized piece at the end that corresponds to “Services:S:71:239:”.
So far I like the profile stuff and luckily it is using the common provider model because the one glaring weakness here is searching. Finding all Users with a specific Property value is going to be very very difficult. My plan is to write my own provider that is a specialization of the SqlProfileProvider but normalizing the data into a PropertyName and Value table. I have not dug deep into the ramifications as it has to do with Groups or custom serialized types, but I don’t think they will get in the way.
If anyone has any comment on this, I am very open to hear what you have to say.