[ZODB-Dev] Any risk about foreign zodb references

Alexandre Garel alex.garel at tarentis.com
Mon Jul 18 12:08:59 EDT 2011


Hello,

We are building up an application where we use multiple zodb instances. 
Indexation is done using solr.
zodb are served through zc.zodbwsgi. ZODB connections are set only 
on-demand, upon traversal. Each zodb has its intid local utility. Each 
object also has a uuid.

I have a zodb with global parameters objects on /params and distinct 
zodb as /foo /bar /baz and so on.
Objects in a zodb may reference objects of the same zodb or of /params.

I have two possible strategies :

- either store uuid of referenced objects and retrieve objects from solr 
(which will give me a zodb name + intid of object)
- either directly reference the objects of /params

Of course second option seems better and more natural.

I read 
http://svn.zope.org/ZODB/trunk/src/ZODB/tests/multidb.txt?rev=99605&view=markup
and using pdb on databases = request.environ['zodb.connection'] I can 
see the zodb.databases map
which is ok. I also know that _p_oid is unique and _p_jar handled for 
each object so I feel confident on this side.

So before I dive into this, is this kind of cross-database reference 
used on production applications. Is there any-risk or any trick to be 
aware ?

Thanks in advance for any comment :-)

Alex



More information about the ZODB-Dev mailing list