MySQL vs XML: pros & cons?

Geert Janssens geert.gnucash at kobaltwit.be
Wed May 18 06:12:04 EDT 2016


On Tuesday 17 May 2016 19:23:37 Don Ireland wrote:
>  From the provided link:
> "Until GnuCash supports simultaneous multiuser use almost all users
> are better off with the XML backend."
> 
> But I've read that before.  My question had more to do with the fact
> that I've read a number of messages in which people WERE using a true
> dB backend and I'm curious what benefit that gives them (I'm assuming
> there is SOME level of benefit--otherwise why would they do it).
> 
> Don Ireland
> 

Hi Don,

The mysql support as implemented currently in gnucash only had one goal in mind: 
immediately saving each change made by the user. This was against a background that users 
sometimes waited too long to hit the save button or simply forgot it. Crashes, unexpected 
power outages and such then resulted in data loss. Hence the sql support was added or better, 
gnucash gained the ability to use a database as the data store. It didn't gain much in the form 
of other database capabilities (like multi-user concurrent access, a normalized data schema,...).

Ironically though, while the database backend was intended to prevent unwanted data loss 
there still is no guarantee it really achieves that one single goal. Since it's original introduction 
several corner cases have been identified where not all data was properly stored in the 
database. At this very moment the developers are fairly confident that the commonly used 
parts of gnucash are properly covered, but can't be sure there may still be some minor 
elements that don't get saved properly (one that's still on my list to investigate is the last run 
date for scheduled transactions).

Regardless of this uncertainty, many users are happily using the database backends as they 
get additional benefit from it like
- easier to extract data for external processing
- more used to working with databases
- the initial goal - direct saves
- easy access from different pc's possibly even over a (public) network (still non-concurrent 
though)
- align backups with existing db backup strategy
- ...

I'm not actively promoting this use. Each user should evaluate for him/herself whether the 
switch brings sufficient benefit compared to the possible overhead of database administration.

Personally I'm still on xml (even as a gnucash developer) as I don't have sufficient benefit from 
using the database backends. That may (and probably will) change the day gnucash becomes a 
true database application. That's still a few years ahead though...

Regards,

Geert


More information about the gnucash-user mailing list