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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Someone explain benefits of XML over DB 1

Status
Not open for further replies.

chrigil

Programmer
Sep 23, 2003
178
GB
Can someone please explain the use of using XML over a database? I'm used to using SQL Server/MySQL etc as the data source for my dynamic websites and can't imagine how using XML would be any easier or more productive. I'm not at all knowledgable on XML (I know the basics) so if anyone can explain the Pros and Cons of DB V's XML I'd really appreciate it.

Thanks in advance

Chris
 
Well, I am going to take a different slant. I say they should be used together. The reasons:

1. XML is hierarchical in nature and so hierarchical data is much easier to access/represent.

2. Through the use of XPath it is VERY easy to access the data in an XML document.

3. XSLT allows you to merge or remove data simply, and also in the case of Web Applications, easilly transform it into HTML for display.

What is XML not good at:

1. Storing and manipulating large amounts of data.

2. Providing secured and authenticated access and storage.

3. Building relational data in the sense of a database i.e. joining tables etc in SQL

What I think is the best solution:

Use SQL Server 2000 to store and manipulate your data. You can then use the
Code:
SELECET ... FORM XML ...
caluse to return your data as XML from the SQL Server database. You can then use XPath, DOM, XSLT etc to access and manipulate this data. Its also very easy to pass about the network and share amongst different applications.

You still get the benefit of the relational database performance, security, and data integrity (as well as ease of use and development). You also then get the benefit of presenting your data to your client applications as XML (or recordset/dataset if you require).

MySQL doesn't provide that functionality yet, but Oracle does a similra thing.

James :)

James Culshaw
james@miniaturereview.co.uk
 
Good explanation, James. (* for you.)

Using XML as a database is like wearing golf shoes in a bowling alley.
 
Yeah I guessed that XML wasn't best suited to a data storage medium, i just didn't realise the two were complimentary

thanks again

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top