← Back to context

Comment by gwbas1c

5 years ago

It depends on how large and complicated your XML file is.

Once your XML file hits a certain size, minor updates incur a gigantic performance penalty because you have to write out the entire XML file every time.

Random writes in the middle of an XML file are impossible. For example, if you were to change an attribute so that it's one character longer, you still have to rewrite the remainder of the file in order to shift everything over by one character.

That's the main reason why SQLite is so popular for applications.

(I know that's from personal experience. I had to support an old version of an application that constantly wrote out XML while the new version that we hadn't shipped used SQLite. A customer that made heavy use of the old version basically hit the limits of XML but the version that used SQLite wasn't ready for them yet.)

But, I'm going to be honest here: We had some tables that only had a few rows, so I moved those to XML files. QE really liked it because it was easy to diagnose issues.

I think it depends on whether you need a file format or a database. All the benefits of a database are wiped out if you are implementing File->Save for a document based application.

  • File->Save is an extremely outdated workflow leftover from when disk drives took multiple seconds and you couldn't edit the document while you were writing to the disk.

    Now your application should continuously save without any manual steps.