Although I have not validated this, I live under the strong suspicion
that Web Part properties that have a different current value than the
default value are serialized into the database as a single XML node. If
the default value is the same as the value in the properties decorative
attribute I doubt that value is stored (except for DateTime and
KnownColor, of course which cannot have a default value attribute).
The root element of the node is probably the XmlRoot Namespace value
provided as a decorative attribute to the Web Part class. Each element
in the node is probably the value given in the XmlElement attribute for
each property or if the attribute is not provided (it typically is not)
then it probably uses the name of the property (or less likely, the
FriendlyName attribute). I suspect that this data is stored in the
tp_PerUserProperties column of the WebParts table for Shared values. The
same column of the Personalization table is probably used for My values;
one XML Node for each unique Web Part + user SID. Unfortunately, the
tp_PerUserProperties value is stored as a <binary> value and I just
haven't had time to try and crack it open (what is the syntax to do that
anyway?).
So, perhaps the node for a Web Part with a string custom property called
Text set to the non-default value "Todd" may look something like the
following XML node:
<myNamespace>
<Text>Todd</Text>
</myNamespace>
If the framework finds a row in the Personalization table for this Web
Part for this user, it uses those values. Either way, I would guess that
it checks for Shared values in the Web Part table. The Shared values are
then used wherever personal values were not found. All other values are
assumed to be the default value defined in the custom property default
value attribute.
Again this is just my speculation (read: "wild guess"). Whether this is
technically true or not has not yet been important enough in the work
I've done with Web Parts to date to require that I validate the hunch.
If someone else knows for sure, please correct my suppositions as
required.