[ZODB-Dev] create unique container keys

Alan Runyan runyaga at runyaga.com
Thu Apr 2 10:22:35 EDT 2009


It seems like such an easy goal: autoincremental integers for a
container.  Is this such a problem because of the ZODB architecture?
or lack there of?  There are two database primitives that everyone
appears to want:

  - autoincrementing integers for containers (tables)

  - indexes (not in application)

The new generation of databases (couchdb, tokyo cabinet, hypertable,
etc) autoincrementing is usually absent.  Though these data containers
usually have index support.

cheers
alan



On Thu, Apr 2, 2009 at 7:48 AM, Stephan Richter
<srichter at cosmos.phy.tufts.edu> wrote:
> On Thursday 02 April 2009, Adam GROSZER wrote:
>> Yeah, uuid was my guess.
>
> Christian was not necessarily thinking uuid. I think the common algorithm is:
>
> x = random.randint(10**9)
> while str(x) in container:
>    x += 1
>
> Regards,
> Stephan
> --
> Stephan Richter
> Web Software Design, Development and Training
> Google me. "Zope Stephan Richter"
> _______________________________________________
> For more information about ZODB, see the ZODB Wiki:
> http://www.zope.org/Wikis/ZODB/
>
> ZODB-Dev mailing list  -  ZODB-Dev at zope.org
> http://mail.zope.org/mailman/listinfo/zodb-dev
>



-- 
Alan Runyan
Enfold Systems, Inc.
http://www.enfoldsystems.com/
phone: +1.713.942.2377x111
fax: +1.832.201.8856


More information about the ZODB-Dev mailing list