[Zope-dev] [announce] for the CVS junkies: multiple ZODB mounting product.

Anthony Baxter Anthony Baxter <anthony@interlink.com.au>
Thu, 01 Jun 2000 23:18:18 +1000


>>> Shane Hathaway wrote
> You did better than you think, Anthony.  I was going to release the
> product I've been putting together, but your little product does
> virtually the same thing.  Good work!

Lucky guessing, and trawling CVS. :)

> There is, however, a major security problem with making it so easy to
> mount a FileStorage.  In my product, per Jim's suggestion I set it up
> so that the user is required to create an External Method in order to
> mount a database.  That actually makes things a little more flexible in
> that it provides you the ability to mount things other than
> FileStorages.

I'm curious - could you elaborate on the security issues of this? The 
convenience of not having to write an External Method each time you 
want to mount or unmount a ZODB is high. :)

> There are still some issues with mounted databases.  The primary issue
> is that they interact strangely with ZClasses.  However, if you have
> the same ZClass defined in both the primary database and the mounted
> database, ZClasses seem to work fine.  (I wouldn't bet my company on
> it, though.)

Yah, I've been thinking a bit about that, and it's not at all obvious
how it should work. In my case, I want to be able to mount something like
/partners/partnerA
          partnerB
          partnerC
with each partner object a different ZODB. Unfortunately, the current
implementation uses ZClasses in each one. So if I upgrade any one, I
have to upgrade all of them. (and then we're back to the old 'how do
you upgrade ZClasses' issue, which, unless I'm mistaken, has never 
really been resolved).

> The other issues are that you can't easily undo nor manage mounted
> databases.  That is more of a UI problem which could be solved by
> product authors, however.  I envision a product that would create a
> "mounted database manager" object.  Inside the database manager you
> could add as many mount points as you want.  The database manager
> object is where you would go to pack any of the mounted databases.

Yeah - the mount points are entirely invisible. One thing I'd considered
doing was to make the Product provide a registry of mount points and their
underlying FileStorages. 

> ... And please report any problems which you may think are being caused
> by the mount.  http://www.zope.org/Wikis is a mounted database and it's
> running fine, but YMMV.

It is? Okay, that makes me feel better.

A couple of issues I'd like clarification on: 

Any mounted filestorage is searched for an object called 'Application'. 
I'm assuming it will also want things like Control_Panel &c as well. What's
the bare minimum a new mounted FS needs? Right now, I'm copying Data.fs.in
and blowing away the stuff in it, but nuking it's standard_html_blah is
a bit more problematic. Would it be worth making a 'create new empty
ZODB FS' function?

If you try to mount /Control_Panel/Products from a mounted ZODB, you get
an 'Attribute Error: _owner'. I'm assuming the Control Panel is special
cased by the ownership code when it's the main ZODB.

How does this work with the Owner mods in recent CVS? If I remember 
correctly, objects keep a reference to their Owner - won't this break
across ZODBs?

thanks,
Anthony