I have a lightweight app that will use some data. I am trying to decide if I should use XML based or just include a mdb file.
Access:
- More performant, particularly in regards to queries
- Better support of relationships beyond simple parent-child.
- Much easier to secure than XML files
- Straightforward upgrade path to SQL Server if there is a need.
XML:
- User editable outside of the application
- Easier integration with third-party tools
- Lightweight retrieval of data, no signficant extra libraries to load.
Really, I don't see a good reason to use XML files as the main data store of your application - you'll quickly run into roadblocks and gotchas. In that case Access is clearly the preferred method. For configuration information ABOUT your application, however, XML is probably an overall better solution.
If you have few items of data to store, and this is very unlikely to increase, XML is Ok... load all data into memory and save it afterwards.
I'd use XML (or a flat file more likely) for some very simple app with well-defined limits on data quite happily... but if it seemed likely that the number of data will get into the thousands I'd probably use MDB from the start.
If it was windows only, that is.
Don't use either, use Firebird instead.
You can run it as a fully embedded database or as a local server with basically zero administration for the user.
Then if needed you can always upgrade to a multiuser server version. It's free and it doesn't become corrupt like Access is prone to do during software or system crashes. You also have all the advantages of a full SQL database which will make some things a lot easier compared to XML if the data is non trivial.
Edit: I modifed the wording that said Access corrupts any time the computer crashes. That isn't true but it is prone to that problem and I've seen it happen many times.
How about both?
I use a CMS that stores the main XML for the content as a string in a single db field. However I do prefer MSSQL DB's over access, but our access driven website run in exactly the same way.
e.g. sId, sDescription (XML string)
Allows me to quickly pull out ALL the data without long SQL statements, and very quickly translate using XSL to xHTML for output. Bonzer!