Ask a questionAsk a question
 

AnswerPerformance inmprovement in Schema

  • Thursday, October 22, 2009 4:46 AMSenthilKumar.TMR Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am having a doubt in developing the schema. How to make sure the schema is giving the good performance.

    1. Is the any best parctise or best way to develop or design the XML schema

Answers

  • Thursday, October 22, 2009 7:11 AMAbhijit Mahato Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    Here is the checklist for BizTalk Schemas:

    1. Nodes Should have appropriate data types selected.
    2.Nodes have restrictions in place (e.g. field length, pattern matching,Enumeration)
    3.Nodes have proper maxOccurs and minOccurs values.
    4.Schema elements are distinguished appropriately.
    5.Clear reasons exist for the values promoted in the schema.
    6.Nodes have proper maxOccurs and minOccurs values.
    7.Target Namespace choice consistent across schemas in project/name.
    8. Schema successfully “validates” in Visual Studio.NET.


    Regards,
    Abhijit
    Abhijit Mahato Please "Mark as Answer" if Post has Answered the Question
  • Thursday, October 22, 2009 4:17 PMsiim04 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You could use custom XSLT for the transformation (instead of BizTalk Map). This way the transformation can be streamlined and template calls (including parameter passing) can be reduced (thus simplifying the transformation). In case of repeating sections in output XML, the repeating sections can be optimised by storing them in parameters or variables and later copying them. Maybe if you could give an example of what you are trying to accomplish (your description is a bit unclear), better suggestions can be made.

All Replies

  • Thursday, October 22, 2009 6:24 AMAbdul Rafay Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There is no performance issue related to schemas. Before you design your schemas you should consider the following.

    1- Schemas are designed according your XML.
    2- All the properties like minOccurs, maxOccurs on records are set.
    3- Enumerators and regular expressions are applied on the relevant fields.
    4- It is better to design the schema with the schema design tool in VS otherwise if you have got a schema from the third party validate it first that it has the correct semantics and code.
    Abdul Rafay http://abdulrafaysbiztalk.wordpress.com/ Please mark this as answer if it helps
  • Thursday, October 22, 2009 6:28 AMMohamedatef Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi,
    you can find different type of designing XML schema here
    http://www.xfront.com/GlobalVersusLocal.html
    and for best practice visit this URL
    http://www.xfront.com/BestPracticesHomepage.html

    Regards,
    Mohammed Atef
    http://mohammedatef.wordpress.com/,please mark reply as answer if it helps.


  • Thursday, October 22, 2009 7:11 AMAbhijit Mahato Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hi,

    Here is the checklist for BizTalk Schemas:

    1. Nodes Should have appropriate data types selected.
    2.Nodes have restrictions in place (e.g. field length, pattern matching,Enumeration)
    3.Nodes have proper maxOccurs and minOccurs values.
    4.Schema elements are distinguished appropriately.
    5.Clear reasons exist for the values promoted in the schema.
    6.Nodes have proper maxOccurs and minOccurs values.
    7.Target Namespace choice consistent across schemas in project/name.
    8. Schema successfully “validates” in Visual Studio.NET.


    Regards,
    Abhijit
    Abhijit Mahato Please "Mark as Answer" if Post has Answered the Question
  • Thursday, October 22, 2009 9:54 AMSenthilKumar.TMR Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Has Code
    I am having a schema with 3 unbounded records (MaxOccurs=* ) like below. Let me explain the requriment.

    For each <Lines> the Element1 and Element2 should be there. So i am using looping functiod and changing the value. After that using custom XSLT spliting the <lines>.

    After that in each <Records1> the element 1,element2, element3,element4 should be there so againg using the looping functiod and Custom XSLT for splitting each record.

    Can anyone tell me,  is this a best way or any other way to improve the performance. Because currently it is taking 1 min to process the XML because the size of the XMl is more than 1 MB and we are getting 1000 msg per minute.

    We are using BizTalk 2006 Standard edition.
    <ParentRecord xmlns="http://test">
      <Element1>Senthil</Element1>
      <Element2>2009</Element2>
      <Lines>
          <Element3>Leave</Element3>
          <Element4>Personal Reason</Element4>
            <Records>
               <Record1>1</Record1>
                     ............
               <Record1>1</Record1>
               <Record2>2</Record2>
                     ............
               <Record2>2</Record2>
          </Records>
    </Lines>
    <Lines>
    ..............................
    </lines>
    </ParentRecord>
    
    
     
  • Thursday, October 22, 2009 4:17 PMsiim04 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    You could use custom XSLT for the transformation (instead of BizTalk Map). This way the transformation can be streamlined and template calls (including parameter passing) can be reduced (thus simplifying the transformation). In case of repeating sections in output XML, the repeating sections can be optimised by storing them in parameters or variables and later copying them. Maybe if you could give an example of what you are trying to accomplish (your description is a bit unclear), better suggestions can be made.
  • Thursday, November 05, 2009 9:17 PMThiago AlmeidaMVP, AnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    There are a couple of things you can do that also increase performance by making the XML messages smaller like:
    * Use attributes instead of elements
    * Element and attribute node names should be as small as possible

    Following these will make the size of the final XML messages smaller and use less space in the biztalk database and less data for biztalk to stream around.
    Thiago Almeida - http://connectedthoughts.wordpress.com
  • Friday, November 06, 2009 10:54 AMsiim04 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You have a good point in using attributes instead of elements when possible (it is a general XML design good practice). However, making node names shorter is dangerous as the names should contain enough information for a human user (e.g. troubleshooter) to instantly understand, what they mean (what information is supposed to be contained within). Thus, extreme care should be taken when shortening the names of nodes (otherwise, it will backfire). Besides, using shorter names does not influence processing speed much (memory consumption is affected more).
  • Friday, November 06, 2009 7:48 PMThiago AlmeidaMVP, AnswererUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    You are absolutely correct. What I meant to say was "Element and attribute node names should be as small as possible while still humanly understandable". So create the names with consideration and reason with names that are understandable but not unreasonably long. Shorter names result in smaller XML messages in the end, the same as with attributes instead of elements.
    Thiago Almeida - http://connectedthoughts.wordpress.com