[ZODB-Dev] I want Object Gadfly

Roché Compaan roche at upfrontsystems.co.za
Fri Jul 18 22:38:13 EDT 2003


* Jim Fulton <jim at zope.com> [2003-07-18 20:52]:
> >You might be interested to know that we can already:
> >
> >    - store associations between objects, not requiring any work on the
> >      object's part.
> >
> >    - do queries on associations
> 
> I think you do binary relations. That is, you store collections of 
> relationships.
> Right?

Yes. What we do is define an association between two classes eg. License
and Customer is a associated in an association called LicensedCustomer.

> 
> >    - do joins
> 
> Do these take advantage of indexes?

Joins are expressed in terms of associations and all associations are
indexed. If we have in addition to LicensedCustomer a CustomerContact
association we can express a join between License and Contact as:

    ('License', 'Customer'), ('Customer', 'Contact')

We call this join plans. We have direct join plans and indirect join
plans. A direct join is a join between two classes for which an
association exists whereas and indirect join is expressed in terms of a
sequence of direct joins eg.:

    direct_join_plans = {
        ('Customer', 'License') : associations.LicensedCustomer,
        ('Customer', 'Contact') : associations.CustomerContact,
        }

    indirect_join_plans = {
        ('License', 'Customer') :
            (('License', 'Customer'), ('Customer', 'Contact'),),
        }

We don't even touch objects when we do joins - we only kick around
integers in BTrees so it is pretty fast.

> >What is missing is a language like SQL, but I think there is enough of a
> >foundation to put that on top. At the moment we do joins with sequences
> >of tuples. We can even discover indirect joins based on existing
> >associations.
> >
> >The part you probably won't like is that we do want it *in* the ZODB
> >because this is where you currently can't do powerful queries -
> >otherwise we would just use an SQL backend with an OR mapping.
> 
> When I say *not in*, I mean that this should be an application of
> ZODB, not something built into the persistence mechanism itself.
> 
> >So, this might not be what you want either but I'd be very interested to
> >explore if there would be any overlap in what we've developed and Object
> >Gadfly, or just share experience of the tricky parts we ran into.
> 
> Cool. Note that, unfortunately, I don't have time to work on Object Gadfly
> myself. I'm looking for volunteers. :)

I love this area so I am willing and hopefully able ;-) Do you have any
specific references one could explore to get a clear picture of what you
want to do or should we pepper you with questions?

-- 
Roché Compaan
Upfront Systems                 http://www.upfrontsystems.co.za



More information about the ZODB-Dev mailing list