ObjectDB ObjectDB

Time Sequence Object Command DB

#1

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:

  1. Each transaction has a time-stamp which is the time the transaction was added to the database.
  2. 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).
  3. 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. 
  4. 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?   

edit
delete
#2

You should be able to use ObjectDB to manage this command database.

You need a few entity classes, e.g. Transaction, Command (and possibly subclasses for specific commands), and Schema.

There should be a one-to-many relationship between Transaction and Command.

Every Transaction will hold a reference to a parent Transaction, and possibly also to child transactions, to support branching.

In addition to storing all the commands and transactions you can also cache the last state in the database. On restore - this cache will be deleted and a new state will be calculated by running the relevant transactions.

ObjectDB Support
edit
delete
#3

Perfect!  Can't wait to try it.  I have posed this question to other database experts and no one has given me such a straightforward reply.  Regards,  Tom 

edit
delete

Reply

To post on this website please sign in.