client-server

David Merrill dmerrill@lupercalia.net
Fri, 29 Dec 2000 12:53:04 -0500


On Fri, Dec 29, 2000 at 11:06:02AM -0600, linas@linas.org wrote:
> It's been rumoured that David Merrill said:
> > 
> > In my design, the database will be maintaining the balance. So does
> > that mean gnucash will be a 'real' accounting system? ;-)
> 
> I haven't seen the schema.  Do you store both the 'ledger balance'
> and the 'trial balance' (i forget what its called), i.e. what's
> not been cleared yet?

Yes.

> And my apologies for dropping into the middle of this: do you store
> the current ledger balance with the account, or do you try to store
> historical balances with each transaction?  I assume the former
> (and the engine dynamcally computes a running balance for the 
> displayed splits).    If the latter, don't you have serious update
> problems?

Not with each transaction, which is unwieldy in case of edits. current
balance, cleared balance and reconciled balance are all stored with
the account.

Additionally, there is a checkpointing mechanism, whereby the three
balances are recorded at configurable intervals (currently the end of
each day but provision is made to enhance that later). This seems to
perform quite well in my tests with 100,000 transactions in my test
database.

The example that was mentioned before was that if you have 10 years of
data, that's about 3650 records (daily checkpoints) to update by delta
when a transaction 10 years ago is changed. It takes the db about 150
ms to do this update. This is an absolutely worst-case scenario.

This is on my PII-400 with slow disks.

Real-world case should never be more than one year ago (because books
are closed at the end of the year for most users), therefore at most
365 records, which takes only 10-15 milliseconds to perform.

The specifics of how often checkpointing is done, as I said, is
configurable. You can say to wait 100 transactions, or 1000
transactions, and then checkpoint at the end of *that* day. So a home
user who did this would get a checkpoint relatively infrequently. My
intent is to allow administrators to tune their configurations based
on usage patterns.

-- 
Dr. David C. Merrill                     http://www.lupercalia.net
Linux Documentation Project                dmerrill@lupercalia.net
Collection Editor & Coordinator            http://www.linuxdoc.org
                                       Finger me for my public key

Three from the hall beneath the tree
	Is, Was, and Shall Be
Come Wyrd Sisters swoop to the ground
Loosen the web that binds us down
Join with the hands of the Weavers Three
	Is, Was, and Shall Be
		-- Is, Was, and Shall Be, Beverly Frederick