[MinneStore] - On the road again

Chris Muller afunkyobject at yahoo.com
Mon Aug 26 17:46:15 UTC 2002


Ross Boylan wrote:

> One point that concerns me is schema evolution. Does anyone know 
> how minnestore or magma cope with changes in class definitions? My 
> recollection was that at least one of them said any change would render the 
> entire database unreadable.

Schema evolution is supported by Magma and is part of its included test suite. 
However, it is something I still want to improve.

To make it happen, you simply make sure the class is defined the new way you
want in the image, then open your repository in adminstrative mode and tell it
to upgrade:

  | controller |
  controller _ MagmaRepositoryController administer: 'c:\myRepository.magma'.
  controller upgradeUsingDefaultBehavior: MyClass.
  controller close.

The "default behavior" alluded above will transfer all instance variables with
the same name to the new schema, all others will remain nil.  Another
alternative when Magma was originally conceived in VisualAge was you could
upgrade specifying an upgradeBlock.  Since Magma can't store Blocks in Squeak
until VI4, all you have is the default.

*Specifying* the upgrade runs very quickly because it only defines how the
upgrade is to be performed, it doesn't actually evolute the instances.  That
happens in real-time as they are retrieved.  Every object buffer in a Magma
file knows its class and which version of that class.  As a client receives old
versions of a class, it evolutes it on the fly.  If a change is then committed
to the evoluted instance, it will get a new buffer written with the latest
class version and won't need to be evoluted anymore.

It also correctly handles when the class is upgraded again, yet all existing
instances have not yet been upgraded to the current version.  It always
upgrades sequentially, as many times as necessary, to the most current version.

The goal of this approach was to minimize "down time", but it opens a couple of
other issues which I still hope to improve.  First, objects are only upgraded
permanently if a change is committed to them.  This creates extra work for the
clients to read objects that never change again but are read frequently because
the client will go have through the upgrade behavior every time its read.

What is there works, but I still have to give how to improve some thought. 
Does anyone else have any input?

Regards,
  Chris

__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com



More information about the Squeak-dev mailing list