On Feb 27, 2008, at 5:33 AM, Laurence Rowe wrote:
Sean Allen wrote:
been looking for anything along those lines.
in particular, strategies and gotchas for how to store objects.
everything i've found is basically just a single type of object
i'm really interested in tutorials and information on the best ways
large complicated hierarchies and all the various gotchas etc.
anything like that exist?
A good jumping off point is the wiki: http://wiki.zope.org/ZODB/Documentation
The beauty of using the ZODB is that it really makes no difference
whether you are storing homogeneous or heterogeneous hierarchies of
If you are likely to have a large number of objects in any one
folder then make sure it is BTree based. This is a scalable data
structure, so the whole list does not have to be loaded into memory
to access a single child object.
Been over that. Still have serious questions. And yes, we have a large
number of objects, something in the area of 16 million at present if
you were to map each relational table row to an object.
The biggest concern I have is how do to the layout/storage so that
this slightly contrived example works:
Product has a brand.
There are many brands.
How do I store so that I can find all products simply and all brands
simply and also so that changes in a brand instance are reflected when
the product instance is deserialized. By 'simply' I mean that it
doesnt really work on our end to have to walk all Products looking
for unique brands. Should just be able to go directly in and get said
brands ( using keys() or similar call ).
If I create 'brand' and 'product' as btrees, then if i do something like
some_product.brand.name = 'something entirely different'
and that brand already exists in 'brand', would it be updated? are
references maintained in that fashion?
do we have to handle manually on update and creation?
Note that we would just be using ZODB not Zope in this scenario.
For more information about ZODB, see the ZODB Wiki:
ZODB-Dev mailing list - ZODB-Dev@zope.org