Loren Shaw
Loren Shaw

Reputation: 466

In need of a data source that is less cumbersome than XML

I'm currently working on a project that will be taking in a large amount of data over a set period of time. I currently do not have access to any database engine on the network my software will be deployed on. As such, I'm working with an XML dataset, and employing an MVC type framework. I chose XML originally because it can mimic to a decent degree the relational design of a database. I store the data in a singleton and my win-forms access the data via objects in my singleton and the win-forms do not have direct knowledge of the underlying data structure.

I'm using .NET 3.5, as the PC's my software will be deployed on are XP computers and not internet connected, and therefore, do not have access to download .NET 4.0. I'm accessing the XML using LINQ to XML objects and storing the element/attribute values into objects and collections that can be accessed through properties and methods in my data access layer.

My main concern is that as the XML file gets larger, the overhead could become overly cumbersome. Other than setting up a database server, would there be a better data storage system to use that would be better than XML? I need my data to follow a relational format for what I'm attempting to accomplish. I've already looked into using delimited/csv formats and those do not satisfy my project requirements.

EDIT: This datasource cannot be embedded into the application, and there will be multiple applications accessing the datasource. There are 2 applications that will be used, a "host" application that will be managing the data and a "client" application which will be used for data collection. The "client" application will have multiple instances over multiple workstations on the LAN.

Upvotes: 5

Views: 174

Answers (3)

user15741
user15741

Reputation: 1412

SQL Server Express LocalDB is an embedded version of SQL server, but requires only a file on the machine running it. This might be a good option, will be smaller, faster, and easier to work with than XML, will have identical syntax and similar performance to a real SQL server and you can use all of the built in .Net SQL libraries and features without installing a third party data store.

You can also have multiple apps connect to the same DB file, and still get ACID features of SQL server.

http://www.microsoft.com/sqlserver/en/us/editions/2012-editions/express.aspx

http://blogs.msdn.com/b/sqlexpress/archive/2011/07/12/introducing-localdb-a-better-sql-express.aspx

Upvotes: 3

RonaldBarzell
RonaldBarzell

Reputation: 3830

JSON is lighter-weight than XML. As for whether you can use it in a relational fashion , that would depend on exactly what you are trying to do. Some relational uses of JSON have been covered here:

Using JSon like a Relational SQL Database (Javascript)

Upvotes: 1

Dave Swersky
Dave Swersky

Reputation: 34810

If file size is your primary concern, you could use compression on the files to keep them smaller on disk. .NET 3.5 has some compression algorithms built in. XML is very repetitive text, which compresses very well. If you are free to break your data up into many files, that many also help keep the sizes down.

Upvotes: 2

Related Questions