nova team mailing list archive
-
nova team
-
Mailing list archive
-
Message #00291
Re: Instance IDs and models in the ORM world
-
To:
nova@xxxxxxxxxxxxxxxxxxx
-
From:
Soren Hansen <soren@xxxxxxxxxx>
-
Date:
Fri, 08 Oct 2010 11:03:13 +0200
-
In-reply-to:
<2590_1286304001_o95Ie0Qj032204_AANLkTik2jL-t=RTdY4vVENX1f+uXCBnb6JNO88WLgvL3@mail.gmail.com>
-
User-agent:
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100915 Thunderbird/3.1.4
On 05-10-2010 20:39, Michael Gundlach wrote:
>> I agree with Jay's comments elsewhere in this thread -- it seems a
>> better idea to use a UUID for your internal_id, rather than a long
>> int. That way, the ID is an extra 64 bits longer, so you can
>> generate them randomly on independent nodes without worrying about
>> collisions.
> I think we discussed this in IRC -- 128 bits turns into a 26 byte
> EC2 ID vs 14 for a 64 bit int, and someone (Soren?) had a strong
> negative preference.
If I did, I think I'm over it now :)
> Actually, I just checked in code only using a 32 bit integer, and
> I'd like some convincing that this isn't sufficient for the
> foreseeable future.
I can provide that. :)
> We want to support 1 million instances, right? Which is 1/4000 the
> keyspace, so we have something like a 1 in 4000 chance of a
> collision once we hit a million instances.
Mm... Not exactly. 1/4000 is the chance of collision for the last one,
assuming an even distribution.
You reach a 1/4000 chance of having had *a* collision before you
even start 150 instances. After a million instances, that figure grows
to 99.99999999999999999999999999999999999999999999999999% or
thereabouts. We're in 99% territory after a measly 200,000 instances.
--
Soren Hansen
Ubuntu Developer http://www.ubuntu.com/
OpenStack Developer http://www.openstack.org/
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups
References