Setting up gnucash to use postgesql back end - close but no cigar ...

Derek Atkins warlord at MIT.EDU
Thu Mar 12 11:03:16 EDT 2015


Jan Steinman <Jan at EcoReality.org> writes:

> I think you have the data model backwards: you're deriving relational
> data from your XML model, no? I'd do a pure relational design, then
> import/export XML from that, if necessary.

Repeat to yourself:  GnuCash is NOT a Database Application.  GnuCash is
NOT a Database Application.  GnuCash is NOT a Database Application.

Now, as you're repeating that to yourself, a bit of GnuCash history --
GnuCash started with a proprietary binary file format.  Then it was
migrated to an XML file format.  At no point at that time in history was
there any SQL.  The GnuCash architcture required all data in-core, and
saved the whole dataset.

Slowly over time we added the interfaces to commit data as it is
entered, which enabled the current SQL backend.  But the core
requirement of needing the whole dataset in RAM was not removed.  It's
too ingrained.  So, to leverage the ability to commit in real-time the
SQL backends were modeled off the in-core data objects (which, not
surprisingly, look similar to the xml data structure..  Somewhat).

So that's where we are today.  GnuCash is NOT a Database Application.
Gnucash *can* use a Database as it's data store, but that's *not* the
same thing.

Moving forward, yes, the goal is to change over into being a Database
Application.  But that's a long Long LONG ways off.  It requires
basically re-implementing the whole underlying data object models to go
off to the database on every request.  It requires locking and
consistency management.  It requires a lot of work, so it's going to
take time.

> Right now, it appears that referential integrity is maintained by the
> GNUCash code, rather than the database. This means you cannot have
> record locking, and cannot make it multi-user without database-level
> locking. (Or at least, locking multiple tables.) It also means you're
> needlessly re-implementing a lot of stuff that a database gives you
> for free.

While all true, somewhat irrelevant.

> You have done a lot of great work, which I don't mean to deprecate in
> any way. I'm not really in any position to commit large amounts of
> time to this, so as I said, I'll quit grousing now. Carry on with the
> good work!

You're not saying anything we don't already know.  It's just a long ways
off.

> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.

-derek

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list