Thursday, November 08, 2007

The COW DB is now working

The Copy-On-Write DataBase now works with minimal functionality. Let's call it version 0.1.

We have 3 kinds of persistent objects:
  1. String,
  2. Table and
  3. Root.

Persistent objects can be nested, and Table is indeed a container for persistent objects with (non-persistent/regular) strings used as keys.

Root subclasses Table, so the root can hold multiple persistent objects--so long as the fixed size of the root is not exceeded. (Default size is 8K.)

The database is crash-proof, as the root is never written from where it is read. There are also a number of integrety checks in root.

The root is serialized and compressed when written to disk; it is decompressed and deserialized when read from disk. However, Java serialization and XML are avoided for performance reasons.

That was the up side. The down side is that there is no space management for the disk file. And there is no way for a persistent object to have a reference to another. These two items comprise the current todo list.

Now, why am I doing all this? My experience has been that databases are just too slow for many applications and it is difficult write crash-proof code otherwise.

0 Comments:

Post a Comment

<< Home