Distinguished Fields vs. Property Fields
One of the vexing problems when designing XML schemas for a BizTalk solution is to decide whether to promote a distinguished field or a property field. You can do both types of promotion using the Promote Property dialog box in BizTalk Schema Editor, but which one do you need?
Well, generally speaking, distinguished fields can only be used in the orchestration engine, whereas promoted property fields can be accessed through all phases of the BizTalk message processing, including orchestration, routing, pipelines, and of course custom code.
Behind the scene, the real difference lies within the implementation of these two types of promotions. For promoted property fields, BizTalk simply takes note of the XPath expression used to point to the property fields, whereas for distinguished field, the values of the fields are actually copied to the message context within the orchestration. The performance difference becomes substantial when dealing with large quantity of messages, or messages with lengthy content. For promoted fields, orchestration engine would have to run the XPath expression every time the field is accessed; but for distinguished field, the engine can simply lookup the values from the message context without having to load the entire document into memory and evaluate the XPath expression. There is also a maximum 256-character length limitation on the property fields. However, even though there is no length limitation on the distinguished fields, writing over 256 characters into the message context will most certainly degrade the performance.
One interesting tip I learned recently is that even though the standard pipeline components cannot access the distinguished fields, your custom written pipeline can do so through the “http://schemas.microsoft.com/BizTalk/2003/btsDistinguishedFields” name space.
In short, use distinguished fields unless you have to access the field when routing the message. And use it frugally to incur less performance penalties.