Performance & scalability issues observed due to non-optimized XMLs
XMLs are extensively used components while coding an application especially when it comes to .NET applications. It not only is used to pass key data items across application layers, but is also used to represent message payload for web services. Its flexibility and ease of use makes is one of the favorites for many. In this article, I have tried to list down some key performance issues as can be observed in the system / component due to non-optimized XMLs. Let’s look at those main issues as are observed –
Resource consumption: XML processing requires utilization of computer resources. Some XMLs are however very large and can cause high CPU, memory and bandwidth utilization to process those large XML documents. High utilization can lead to low response time or even low capacity support related issues. Low bandwidth availability further worsens this problem.
Transformations: Building XPath queries that are inefficient or choosing an improper transformation approach can impact on application’s transformation logic. XML needs to be created and data needs to be transformed just before it leaves the application. One should try to keep data in binary format till the maximum time he can so as to achieve an improvement in the performance.
Data caching: It is important to cache the data at appropriate instances. Fetching the same for every request may cause bottlenecks and impact performance.
Dataset usage: A lot of developers use dataset as XML store. Though datasets can be used as XML store it is not really datasets are being designed for. It provides data caching features and those can be used to pass data from one layer to another whenever required. Using it as XML store may result in creation of inefficient XPath queries.
Huge memory consumption: Usage of XmlDocument or XPathDocument can require huge resource requirements in terms of memory expectations. Huge memory consumptions at this layer may impact performance and affect by causing scalability related issues.
Thus, with properly optimized XML files and an appropriate usage of data in the XML messages, one can create well optimized and better performing XMLs. In my next article, I will highlight some tips to optimize your XML messages. If you have any more issues that you might have observed due to improperly optimized XML message. Please feel free to put up comments.