← Back to team overview

nova team mailing list archive

Re: Instance IDs and models in the ORM world

 

On Tue, Oct 5, 2010 at 2:43 PM, Jay Pipes <jaypipes@xxxxxxxxx> wrote:

> keys) across multiple nodes.  A random 32-bit integer would be fine as
> long as the generating algorithm produced acceptable collision rates.
>

I'm using randint(0, 2^32) atm.  The chance of collision is intuitively
something less than 1 in 1000 after adding a million instances.  Ed, I don't
see the need for a 128-bit ID when 32 bits almost suffices.

This would be bikeshedding, except that I don't know how to make a
larger-than-32-bit integer work in sqlalchemy without becoming
implementation-specific.  I think I read that sqlalchemy has a BIGINT type
that's only usable with mysql, for example.  If someone knows how to make an
internal_id column that is 128 bits and happily stores itself in any mysql
backend, I'm fine with 128 bits (and you can argue with Soren about it :)

Michael


Confidentiality Notice: This e-mail message (including any attached or
embedded documents) is intended for the exclusive and confidential use of the
individual or entity to which this message is addressed, and unless otherwise
expressly indicated, is confidential and privileged information of Rackspace.
Any dissemination, distribution or copying of the enclosed material is prohibited.
If you receive this transmission in error, please notify us immediately by e-mail
at abuse@xxxxxxxxxxxxx, and delete the original message.
Your cooperation is appreciated.


References