Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much is too much data for and XML file, and what are some file based database alternatives?

I'm writing an application that keep track of a library of music, and I need a way to store the list of tracks, albums and other data. Usually for something like this I would use an XML file to save the data. And then I would use an ADO.NET DataTable to manipulate the data. But this program could potentially be saving a large number of data items. Also I'm going to want to be able to quickly search, sort, and filter the table of songs.

So my first question is there a best practices limit on how much data should be stored in a single XML file before it's a better idea to be using a relational database? Second what are some alternative options for how I store this data in a single file. Keep in mind I don't want the program to rely on there being a server (MS SQL, MySQL etc.) running somewhere that it can connect to. I want the data stored in a single file. Also I'm not a huge fan of MS Access. So while there are ways for ADO.NET to access an MDB file I'm looking for other options.

Another option I'm considering is sticking with serializing/serializing my collection of "Track" objects to/from XMl. Yet doing any database type stuff like searching, sorting, filtering using Linq on the collection. I haven't used Linq yet, so I'm not sure of the specifics for how this would be done, or if it would be the best option.

like image 799
Eric Anastas Avatar asked Dec 13 '09 00:12

Eric Anastas


People also ask

What is an alternative to XML?

YAML, HTML5, JSON, JavaScript, and Python are the most popular alternatives and competitors to XML.

Does XML allow for data storage in a separate file?

With XML, the data can be stored in separate XML files. With a few lines of JavaScript code, you can read an XML file and update the data content of any HTML page.

Is XML good for database?

XML is a very useful technology for moving data between different databases or between databases and other programs.

What kind of data is stored in XML?

XML Database is used to store huge amount of information in the XML format. As the use of XML is increasing in every field, it is required to have a secured place to store the XML documents. The data stored in the database can be queried using XQuery, serialized, and exported into a desired format.


1 Answers

While I can't answer your questions regarding XML, I believe the solution to your problems is SQLite. It's an extremely fast and lightweight file-based SQL db that doesn't require a server. You can also use something like System.Data.SQLite to interact with it from within .NET.

like image 132
Scorpion Avatar answered Nov 10 '22 00:11

Scorpion