PDA

View Full Version : XML = Easy Database ?



andrthad
September 24th, 2003, 12:04 PM
Hi folks,

I'll begin by saying my knowledge on XML is very limited. I have seen xml files. When looking at the files it appears that they are very clean structures of data that are layered and other data is nested inside.

I have kind of put off XML because I have experience in databases, mostly MS Access, but I am learning PHP/MySQL. Is there really any more functionality that XML can give you versus a MySQL database?

Jubba
September 24th, 2003, 12:08 PM
XML is not (or should not [in my opinion]) be used as a substitute for a database. The information is not secure and too easiloy accessible. I use PHP, mySQL, and XML together and that is usually the best way to do it.

If you have a simple blog or news section that you need to update easily and you don't care if people can get at your information then XML might be the right choice, but if you are storing large amounts of data that need to accessed and edited on a regular basis, then a database is what you want...

andrthad
September 24th, 2003, 12:18 PM
I totally agree with you on the use of XML vs DBs. But how do you use XML and PHP/mySQL together. It just seems to me that as you said an XML file is easily updated by most people whereas a DB takes permission and some amount of skill to update. XML appears to be a structured data text file.

awligon
September 24th, 2003, 12:19 PM
Very true, when dealing with a relatively small amount of data, it really doesn't matter how you store the data where security isn't an issue. However, when you get up to larger amounts of data, searching a gigantic xml file each time will always be much much slower than the search methods implimented by your more common db's such as MySQL and MS Access. Like Jubba said, XML's more for easily updatable little news sections and such if you're talking strictly storage.

On the other hand, XML is very useful in applications where data needs to be communicated b/t server and client comps and such. Many languages are using built in export data to XML file functions now and vice versa. This means you can easily query the db from a client comp, and send that data as XML back to the client comp which is important because XML will probably be the next universal data language.

andrthad
September 24th, 2003, 02:23 PM
Very cool awligon. I think I might know of an example of what you are talking about.

A friend of mine has been doing a ASP project where he obtains shipping quotes from UPS. He sends them a XML file describing the shipping conditions (to, from, how many days) and then they send back a xml file with the shipping quote. You parse through the file and display.

I guess the old school way of doing this would be a text file with variables strung together.

awligon
September 24th, 2003, 03:54 PM
Or just POSTing data w/ php, but the XML data is completely independent and has cross-platform capabilities which is why so many developers and the .NET stuff is going towards XML for data transfer. I'm starting a huge software dev project using .NET w/ ASP.NET and VB.NET and that's the way I'll be passing data as well creating and destroying temp xml files