[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Database Implementation Naivete



>I am considering implementing a database in lisp for managing
>information on chemicals. Till now I have been saving objects to files
>and then reloading them. With the number of chemicals now approaching
>2000 this process takes too much time. Additionally I never take
>advantage of having all the information loaded.
>
>My needs are quite minimal. No transaction restarts or SQL (yet).
>
>I thought a file in a specified, fixed format could be used to store the
>information. The FILE-POSITION function would be used to move around the
>file. READ-CHAR, WRITE-CHAR, READ, WRITE, etc. used to retrieve and store
>information.
>
>Being inexperienced in this area I have several questions:
>
>1) Is this approach likely to work? I know commercial databases offer
>numerous capabilities which probably make them very complex to implement
>but can one start small?

You can certainly do it with that approach, but READ-CHAR & WRITE-CHAR
will likely be quite slow. You'll end up spending a lot of time
managing the memory in the file and indexing your information so that
you can find it. I've written a simple object oriented database that
may fit the bill. It's called "Wood" and is available for anonymous
FTP from cambridge.apple.com in the file "/pub/mcl2/contrib/wood-0.5.sea.hqx".
If you don't want to download the whole thing, the documentation is
in the file "/pub/mcl2/contrib/wood.doc".

>
>2) Are there any references which discuss the implementation of simple
>databases? I have found countless books on database architecture and
>implementation issues but none on how to sit down and start coding.

I don't know of anything. For Wood, I read a little bit about B-trees and
transactions & recovery (which is not yet part of Wood, but will be
eventually if I get the time to work on it), then started coding.