[Zope-dev] Globally unique id's in Zope in a new way

James W. Howe jwh@allencreek.com
Thu, 09 Mar 2000 09:35:03 -0500


At 07:49 PM 3/8/00 -0500, Jason Spisak wrote:
>Zopsters,
>
>I use the Catalog for quite a bit of jumping around the ZODB, and have a
>30,000 plus objects in a system.  I like the idea of not having to worry
>about id's conflicting with other numbers that might appear (invoice
>numbers, employee numbers, etc...) so I don't like to use a counter for
>ids.  [...]


I have the same problem.  I want to automatically create objects and I'm 
currently using the time method.  When I bulk add objects, I would get a 
collision on the time value, so I simply remembered the last id and added 1 
to that value.  It works for my current needs, but I wish Zope provided a 
standard mechanism for generating unique id's.

For example, it would actually be nice if Zope provided an implementation 
of UUID (called GUID by Microsoft).  A UUID is a guaranteed unique 64-bit 
value.  It's used in COM, CORBA and other systems which need to have 
automatically generated guaranteed unique values.  The nice thing about 
UUID's is that they are guaranteed to be unique network wide.  In other 
words, you (supposedly) can't generate a UUID which would ever conflict 
with a UUID that I generated.  It does this by an algorithm which takes 
into account things like time-of-date, network card address, etc.  I don't 
have the details on the algorithm but I know it is publically 
available.  It would probably best be implemented at the C level.

Just an idea.


James W. Howe				mailto:jwh@allencreek.com
Allen Creek Software, Inc.		pgpkey: http://ic.net/~jwh/pgpkey.html		
Ann Arbor, MI  48103