Friday, March 9, 2012

Performance of XML vs Database

What is the performance comparison for XML and database?

Using system.IO to read the XML file will be slower than reading data from database , if only read data and not sorting?

The RAM/CPU memory usange will be higher for get data from XML compare to get data from database?

Hi,

You cant say that database is better than XML, its upto the scope of your need,the size of your XML and of much operations you are doing on XML file..

you can use DOM to read and if it is small file just load it at the start and maintain that till the end of the application..

Cheers


|||

happychai:

What is the performance comparison for XML and database?

It depends on the structure of the data. If it is a small file with something like a parent node and a child node with some attributes, and nothing that is relational then XML can be faster.

You will load the XML document once into the DOM and can you XPath to query the data very efficiently.

If you are going to edit data or the data structure is relational that always go for a data base.

|||

thanks for the reply, beside this i want to know is the performance on resouces use.

Is it using system.IO to read the XML using more CPU/Ram resouces than database?

|||

happychai:

Is it using system.IO to read the XML using more CPU/Ram resouces than database?

It all depends on the stucture of the XML and the query involved.

If the file is small and you are only doing a simple parse/xsl then the XML file should be faster but only neglible once the document is loaded into the DOM. Though you should not be basing on performance as a indicator for using XML or a database. With connection pooling and light weight data providers/objects, databases are also very quick.

|||

ok...

thanks for your reply

No comments:

Post a Comment