We (www.s2ssystems.com) have a time-sequential object command database. I would like to see if it can be built and run efficiently on ObjectDB.
The requirements that drive the design of this database are:
- Each transaction has a time-stamp which is the time the transaction was added to the database.
- The user can efficiently restore the data-model to a specified time which requires reloading the database from the initial time up to the specified time (could be done more efficiently in some cases by rolling back transactions).
- A transaction contains a set of commands which (in general) are create object, change object (fields), delete object, and object-method execution commands. Method commands are generally used to trigger creation of transient objects.
- The database can be branched (and forms a tree with the root at the top and leaves at the bottom); the user selects a leaf to load which is linked up to the root and then the DB is loaded from the root down to the leaf.
The obvious design solution is to write the transactions to the database in sequence. This is very efficient in that database writes are always appends to the end of the file. The down-side of course is that you have to load all the transactions rather than simply the latest state of all the objects. In practice, this does not seem to be an issue and has the advantage of retaining all previous states which you can efficiently go to as mentioned in (2). Appending has a huge advantage in keeping replicated databases in sync: you need only append new transactions on the end. We find this very advantageous in collaboration where local replicated databases are used for performance reasons.
Note again that the database is not an object database, but rather a command database. You can of course think of the commands as objects, which is true. Commands must, however, be executed in their time-ordered sequence. Object schemas are stored in the database and updated schemas are added in sequence in the database without having to update objects defined using the older schemas. When the database is loaded, it will first load an object schema, then the object, then perhaps a new schema and a new object of the same class. In memory, all objects are defined by the latest schema.
So is there a way to extend ObjectDB to support these requirements?