saving data to xml

  • Thread starter Thread starter adrin
  • Start date Start date
A

adrin

hi,
i am writing a program that is supposed to create a database of my music
and albums.
i want it to consist of 3 'modules' input<->processing<->output. input
should enable reading data from cd or mysql db or xml, output should save
data to xml/mysql.
since im a total xml/.net/c# newbie i would like to know is XML suitable
for storing data?(database would include such information as album title,
artist, genre, and so on). Is there a way to universally 'connect' data
from xml and mysql(or other DB) source?datagrid?
What would you suggest? ;)
 
XML would start squeaking as it gets bigger, because eventually you're going
to store it in a file, and then loading and parsing that file may take a
long time (and a lot of resources) as your file gets bigger.

In general, if you're doing DB work, use a DB. MySQL would be just fine for
that purpose. If you're not going over 300K records, even ms-access would do
(and then you get the benefit of a portable file that is your DB).

XML would be completely unscalable for that purpose, and I'm guessing
performance-wise a DB would also be faster.

Hope this helps.

--itai
 
XML is more appropriate for formatting the data for transportation between
your modules. And for eating up Internet bandwidth... But that's a
different topic.

Dale
 
Please read about Web Service SQL Server and Data Set..

In the same time not to be forgotten that only XMLDocument class load the
whole XML file into memory before it execute a method. You have fast readers
like XMLTextReader, XMLReader etc for sequencial reading..

Nirosh.
 
Hi Adrin,

You can do it, but keep this in mind.

It is always a single user approach.

You are reading and writing the dataset as one file in memory, if your
computer crashes you loose the updates done after the last writing (and the
approach allows not very much writing back).

When you write back, you have to use a very secure method, because when you
get an error in between, you loose all your data, so a tempery file is the
least you have to make.

You can use for it,
dataset.readxml(path)
dataset.writexml(path)

The performance will be probably, when it is a small databass better than
with a real database.
When it becomes a hugh database the performance of a real database will be
better.

My biggest disadvantage against it, that it is insecure because a user can
delete that XML dataset on disk by accident.

Just my thought about it.

Cor
 
Back
Top