Subject Re: [firebird-support] Who's using some GUID (Global Unique IDentifiers) in FB?
Author David Johnson
It's been a while since I read the details on the spec, or I would cite the primary source. Sorry. I know how important primary sources are.

If your implementation follows the specification, then it is guaranteed unique. While one part ofthe algorithm is a random number, the rest of the algorithm includes such things as the time of day and the MAC address of one of your NIC's.

With that said, there are many UUID like algorithms out there that do not implement the full algorithm as detailed in the specification, or use a similar but not identical algorithm that produces different but similar results to the speciied algorithm. Furthermore, if there is no NIC to provide a MAC address, other sources for system specific identification may be substituted, such as BIOS serial number.

The date was computed on the basis of the specification's usage of date and time as part of the algorithm. The algorithm is rated for 1,000,000 GUID's per second per machine. Since part of the algorithm is a unique physical characteristic of the machine, regeneration of a given GUID must occur on that machine (or more specifically on a machine with that same MAC). Hence, the computation for one machine's time to possibly regenerate the same GUID is true for all machines. On wintel boxes, that do not measure time to 0.000001 second, the system uses the time of the initial call as the seed value for the time component, and then increments that value by 1 for every request for a GUID.

This presumes that MAC addresses and BIOS serial numbers are not duplicated, and that system clocks are reasonably close to correct. It is hypothetically possible to reset your system clock and reproduce the same GUID on a specific system, which is where the "random" part of the algorithm comes in. So, technically, it is remotely possible to generate the same GUID twice on the same physical machine, but it would be very unlikely to occur even if you went to the trouble of doing that.

Most operating systems, including Windows and linux, keep their internal system clocks set on UTC, and apply math to give localized time to users and applications. Since GUID creation is typically an OS call (except to Java programmers), it uses the UTC system clock rather than the localized application calls.


----- Original Message -----
From: Geoff Worboys
To: firebird-support@yahoogroups.com
Sent: Wednesday, April 07, 2004 9:45 PM
Subject: Re: [firebird-support] Who's using some GUID (Global Unique IDentifiers) in FB?


> However, it is guaranteed unique until the year 3040.

Can I ask where you got this snippet of information?

Specifically the ideas of "guarantee" and "year 3040".

I thought that GUIDs were effectively random numbers, created
in such a way that the _chances_ of duplication were extremely
small. But still only chance and not a guarantee.

I am guessing that the date must come about from estimating
how many computers there are generating so many GUIDs per
second that a duplication is likely by that time. (Of course
if you use GUIDs for a purely in-house database across 3 PCs
you can probably expect them to be useful for much longer. :-)

--
Geoff Worboys
Telesis Computing



------------------------------------------------------------------------------
Yahoo! Groups Links

a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

b.. To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com

c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



[Non-text portions of this message have been removed]