[Zope3-dev] zwiki: performance of findChildren()

Jeremy Hylton jeremy@zope.com
22 Apr 2003 18:37:10 -0400


On Tue, 2003-04-22 at 17:30, Jeffrey P Shell wrote:
> Well, then we get into the design issue of 
> Bob.receipts.receipt1.purchaser pointing back to Bob.  Actually, I just 
> don't know how to design for this scenario in the ZODB/Zope.  I've 
> heard that (at least, up until recently) maintaining hard persistent 
> links to objects elsewhere in the tree was a bad thing to do.  Even now 
> - for some reason, I'm scared of doing it (maybe it's just the lack of 
> an event framework to catch deletes, etc).

I don't think I understand yet.  Why do you need an event framework to
catch deletes?  Or is that a side issue?

One of the primary goals of ZODB is to be transparent.  Just write
whatever Python code seems the most natural.  I can't think of any
reason to avoid references to objects elsewhere in a tree.  (There's
only one kind of reference in ZODB, so I think the modifier hard is
unnecessary.)

> I'm used to the relative ease of joins in SQL, yet in ZODB I often feel 
> rather constrained by the containment-only relationships (or have to go 
> out of my way to build catalog indexes, or do BTrees, path lookups, 
> etc).  I'm curious about moving out of this sphere, yet having the same 
> relative ease I get out of an RDBMS/SQL to be able to relate one thing 
> to another almost arbitrarily.

The discussion is a little abstract for me.  Do you have a simple
concrete example of how you would do it in ZODB and how you would do it
with an RDBMS?  Then we could try to understand why one is more or less
natural.

Jeremy