[ZODB-Dev] Support for graceful ZODB Class renaming

Neil Schemenauer nas@mems-exchange.org
Thu, 16 Jan 2003 15:34:11 -0500


On Thu, Jan 16, 2003 at 03:14:25PM -0500, Jim Fulton wrote:
> Problem
> 
>   A long-standing problem in ZODB is that renaming/moving classes
>   or modules is painful, because module and class names are scattered
>   throughout databases.

We have experienced this problem very often.  Nearly every software
release we make includes some database massaging.  We handle this by
having a script that opens the DB using FileStorage and makes the
changes.  We don't use __setstate__ methods.

>   1. The classic solution to this problem was to create aliases for the
>      old names.

I did not know that trick.

>   2. Another approach would be to write a data conversion utility for the
>      database. This would require a conversion file much like the alias file
>      described above.

I think we would prefer this approach.

>   3. A more sophisticated approach is to build a table, stored in the
>      database providing a two-way mapping between a unique id and a
>      class module and name.

An interesting idea.  I'm guessing that reducing the pickle sizes might
help performance.

>   4. A variation on approach 3 is to have class authors explicitly
>      assign globally unique IDs (GUIDs) to classes.

Doesn't sound very ZODB-ish.

  Neil