Pat Spinler <[EMAIL PROTECTED]> writes:
> > This is something I've wondered, not being a big database person
> > myself. Is there some technical reason why no one has ever
> > implemented a free "database in a directory" system?
>
> A couple of reasons -
>
> *) most file systems don't handle the "lots of very small files in a
> directory" very well.
Well, for the scale of database I'm talking about (one database per
user's collection of accounts), you could theoretically do it all in a
single file if you were willing to go to a lot of hassle.
> *) You don't get many of the other nice db features
> -) fast key lookup
> -) relational model (vrs hierarchical for a filesystem)
> -) complex data joins
I wasn't imagining an industrial strength database, but I did mean one
that was a full relational database with much (if not all) of the sql
functionality, but one that stored an entire database (given whatever
scope that entailed for a particular project) inside a single file or
directory subtree, (I wasn't talking about one file per record or
anything.), and one that wasn't concerned with multiple user access,
or distribution issues.
Basically inside an app, you'd say something like this (or more
likely, use something like sql):
User creating a new "gnucash file":
(set! foo (somedb:create-database "/home/rlb/personal-accounts.gnc"))
(somedb:create-table foo ...)
(somedb:create-table foo ...)
(somedb:close-database foo)
and to add a transaction:
(somedb:add-record transaction-table ...)
or an account
(somedb:add-record account-table ...)
and if we had triggers, we could use those for refreshing the gui,
etc.
Basically, I'm talking about something like what we've got right now
via our engine, but implented on top of a presumably more regular and
powerful, standard database abstraction/engine, an engine without the
completely superfluous (in this case) complexities normally associated
with traditional SQL implementations --- basically an SQL without
administration, distribution, or access issues that doesn't centralize
storage when that's irrelevant. I think there are a lot of apps that
could use this.
> *) There's a couple of reasonable small packages out there now. E.g.
> dbm, MySQL, etc.
I don't know about dbm, but MySQL (at least last time I checked) was
non-free.
> btw. this is exactly one of the reasons behind the development of
> Reiserfs. It's supposed to allow you to store lots of small bits of
> hierarchical info, such as broken out config files, in "filename =
> key, contents = value" scheme, and do it efficently.
That sounds great. Might as well let your filesystem be your database
when you can. Get the code right once and then enjoy it.
--
Rob Browning <[EMAIL PROTECTED]> PGP=E80E0D04F521A094 532B97F5D64E3930
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]