Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML vs. Database - pros and cons

Status
Not open for further replies.

foshae

IS-IT--Management
Oct 27, 2005
2
US
We are in the process of planning the development of our first web-based News Managament System, which will allow our clients who do not have programming experience to manage news articles on their website. My question is this, can anyone tell me the pros/cons of using XML to store the article data vs. a relational database? We are planning on storing the user data in a database, but was thinking of saving all of the article content into XML files.

Thank you in advance for your help.
 
For highly-structured data: XML
Security & Access rights: Database
System Interoperability: XML
Ease of document transformation: XML
Searching speed: Database
Maintainabillity: Database

These are the main points to consider. I would rank them according to your needs and see which comes out on top.

Personally, I would probably lean towards a database, although I would certainly look at storing the XML in a database or native XML database. Hard to say without more info.

Jon

"I don't regret this, but I both rue and lament it.
 
Hmmm...

You might want to add

Administration: XML

Unless you are already incurring the cost of administering a database (for some other purpose) then this will be a significant factor.

Tom Morrison
 
Thanks for the feedback...

We are planning on storing the category and article data in XML files. The administration system (written in .NET C#) will read/write/modify these files. When the admin updates/creates an article, the admin .ASPX page will use the XML data to publish static HTML pages. We are planning on doing this so all of the article pages are "search engine friendly" and so we can use the XML data to Syndicate content. Does anyone see any limitations or possible issues with this approach?

Here are some questions to your repsonse...

Security & Access rights: Database
Can't we password protect or hide the directory where the XML files are?

Searching speed: Database
Are you saying that if there is a "search" feature, it will take longer to pull the results from an XML file verses a database?

Maintainabillity: Database
Please explain what you mean by this.
 
Your general approach is fine. You can use XSL to transform the XML to HTML and RSS and all will be good. Nothing stopping you from storing the data in database and transforming to XML first. Or storing as XML in database.

Security & Access rights: Database
Can't we password protect or hide the directory where the XML files are?

Yes, but its easier to set up user profiles on database if you want to restrict access to certain groups.

Searching speed: Database
Are you saying that if there is a "search" feature, it will take longer to pull the results from an XML file verses a database?

Yes, you can't index XML files.

Maintainabillity: Database
Please explain what you mean by this.

Easier to backup, manage and log stuff on a database than a file system.

Jon

"I don't regret this, but I both rue and lament it.
 
Yeah, fair point.

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top