views:

177

answers:

4

Hi,

I am designing a db application using a novel approach. (atleast novel to me... :) )

So I am doing some research for the same.

I am using .NET 3.5 ADO.NET Datasets to work with data and store it offline in XML.

First, is this approach any good for a serious (though a small db, 4-5 users, ~25 tables ~3-4k records in each) application?

Second, how do I exactly store a datarelation in an offline XML file?

Thanks!

Saurabh.

+3  A: 

25 tables with 3-4k rows in each is not what I'd call "small" for xml; in particular, it isn't easy to jump to just the right data in xml...

Have you considered a database, such as SQL Server Express Edition. Free, and more than up to this job.


Re storage; if you are using the inbuilt serialization a DataSet, this should just work automatically. Of course, the xml will then be specific to DataSet... I honestly don't recommend the DataSet/xml approach.

Marc Gravell
A: 

I second Marc suggestion. Do not go the XML route. You probably don't know when/how will your app grow. With xml you don't have transactions, check constraints to guard integrity of your data, ....

Databases are not just dumb storage. Use some free express db version. This way you could easily migrate to more professional DBMS versions.

Petar Repac
+1  A: 

To answer your question (even though I agree with Marc, you shouldn't be using XML as a data storage layer).

Ids and hrefs are commonly used for creating relations in XML (which is hierarchical and not relational, again, you shouldn't use XML).

As a small example:

<region name="South Africa" id="region_1">
    <manager ref="#employee_1"/>
</region>

<employee name="John Doe" id="employee_1" region="#region_1">
    <manages>
        <employee ref="#employee_2" />
    </manages>
</employee>

<employee name="Cyril Smith" id="employee_2" region="#region_1">
    <manages /> <!-- code monkey -->
</employee>
Jonathan C Dickinson
I answered so that other people can see how to do this: i.e. if they are not abusing XML.
Jonathan C Dickinson
A: 

I would agree with other posters. I wouldn't go with XML in your situation. To suggest something different, try SQLlite: http://www.sqlite.org/ and the .NET ADO: http://sqlite.phxsoftware.com/. It's not a super powerful database, but it's free and gets the job done.

However, if you see your app's database growing in size in the future (more users, more usage, etc.), you should go with a more powerful database like SQL or MySQL.

If you're absolutely bound to XML for whatever reason, I would agree with Jonathan's suggestions.

Brandon Montgomery