Versioning and persistence

Scott L. Burson gyro@zeta-soft.com
Tue, 20 May 1997 14:10:19 -0700 (PDT)


   From: Jordan Henderson <jordan@Starbase.NeoSoft.COM>
   Date: Mon, 19 May 1997 19:33:23 -0500 (CDT)

   Chris Bitmead writes:
   > What use are you going to make of a cons cell with a version number?

   Well, when I said every object, I suppose I should have qualified that a
   bit.  Any object that can have an invariant reference applied to it, like
   those associated with interned symbols, could have a version number.

   > Jordan Henderson writes: 
   > >Of course, it should be
   > >possible to defeat this default versioning by setting parameters specifiying
   > >the maximum number of versions to be maintained (setting this to 1 would
   > >mean no versioning).
   > 
   > Sounds like fun that every time you create an innocent little object
   > you have to go and switch off this dratted versioning thing.

   You could just set the global default to be no versioning, if that's 
   what you want.  Of course, you never know when you might WANT to go
   look at an old value of FOO, or an old definition of Set-cursor, etc.

   It doesn't make sense, of course, to turn off versioning for individual
   cons cells that aren't referred to by symbols, because you'd have no
   way to refer to the cons cell in the first place to specify the new
   versioning parameters.

   I'll rephrase my position so it's immune to the extreme case you cite.
   Versioning should be supported for any object that has a named reference
   to it at a very low level. 

I believe the standard way versioning is dealt with in OODBs is at the segment
level (a segment being a collection of objects that are treated together for
various purposes -- typically a segment is stored in a single disk file).

To explain this I need to introduce the concept of named roots.  It's very
simple: one can register any object as a named root of a given segment by
supplying the name (a string).  Later, one can open the segment and access any
of these roots by name.  This is the only well-defined way to get one's hands
on an object within the segment if one doesn't already have a pointer into it.

Now back to versioning.  Most code simply manipulates objects with no concern
for versioning.  However, one can open a specific version of a segment and
retrieve one of its named roots.  Once this is done, the object is like any
other object.  At least as long as one is accessing only a single version of
any segment at a time, everything works straightforwardly.

Accessing more than one version of a given segment at a time gets a little
weird because different versions of an object are not EQ.  I'm not sure how
much of a problem this is in practice.

-- Scott