TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Brief History of the UUID

304 pointsby mrbbkalmost 8 years ago

17 comments

tytsoalmost 8 years ago
I can actually fill in some of the details about the history of UUID&#x27;s. Paul Leach was an architect who worked at Apollo, OSF, and later Microsoft. I met Paul in the mid-90&#x27;s when he was an architect at OSF, and I was the tech load for Kerberos v5 development at MIT. OSF DCE was going to use Kerberos for authentication, and was going to use Apollo RFC as its RPC layer.<p>It was from talking to Paul that I learned about UUID&#x27;s, and I added libuuid into e2fsprogs 1.05, released September 7, 1996. UUID&#x27;s were used in Linux in the ext2 superblock, and later on, GNOME picked it up and used it extensively, which meant among other things that if you wanted to run GNOME on FreeBSD or NetBSD or Solaris, you had to compile e2fsprogs to get libuuid. :-)<p>Later on Paul went on to Microsoft, and I&#x27;m fairly certain that it was due to Paul that Microsoft adopted the OSF DCE RPC layer for its internal use, and UUID&#x27;s started being used extensively inside Microsoft. UUID&#x27;s also got used in Intel&#x27;s EFI specification for the GPT partition table, although somewhere along the way they got renamed &quot;Globally Unique ID&#x27;s&quot; --- it&#x27;s the same spec, though.<p>While Paul was at Microsoft, the specs for UUID&#x27;s finally got standardized by the IETF as RFC 4122, so you no longer needed to get find dated copies of the OSF DCE specification (or download e2fsprogs since I had an early version of the UUID Internet Draft in the sources long before it finally squirted out the other end of the RFC publication pipeline).<p>As far as uuidd is concerned, the reason why it exists is because a certain very large Enterprise Resource Planning system was using libuuid to generate uuid&#x27;s for its objects, and it needed to create them very, very quickly so they can initalize the customer&#x27;s ERP database in finite time. They were also using the time-based UUID&#x27;s, with the UUID stored in the database with the bytes cleverly rearranged so the time bits would be stored in the LSB, and the Ethernet MAC address would be in the MSB, so that a database using a B-tree (plus prefix key compression) for its indexing would be able to very efficiently index the UUID&#x27;s. This is similar to k-ordering trick that Flake was using, but this very large enterprise planning company was doing in 2007, five years before team at Boundary came up with Flake, and they were doing it using standard UUID&#x27;s, but simply storing the Time-based UUID bytes in a different order. (I believe they were also simply storing the ID in binary form, instead of base-62 encoding, since if you&#x27;re going to have jillions of objects in your ERP database, you want them to be as efficient as possible.)<p>Anyway, a certain Linux distribution company contacted me on behalf of this very large Enterprise Resource Planning company, and we came up with a scheme where the uuidd daemon could issue blocks of time-based UUID&#x27;s to clients, so we could amortize the UUID generation over blocks of 50 or 100 UUID&#x27;s at a time. (This ERP was generating a <i></i><i>huge</i><i></i> number of UUID&#x27;s.) I did it as a freebie, because I was tickled pick that libuuid was such a critical part of a large ERP system, and it wasn&#x27;t that hard to implement the uuidd extension to libuuid.
评论 #14510110 未加载
评论 #14513412 未加载
评论 #14511327 未加载
Animatsalmost 8 years ago
In the early days of network interface, unique IDs were a problem. It was once suggested that each network interface have a $1 bill attached, with the serial number of the bill being the adapter ID.<p>This was a real problem in the early days of low-cost Ethernet controllers. Some manufacturers didn&#x27;t buy their own address space [1], but reused that of some major vendor. (Usually 3COM) This resulted in occasional real-world duplicates.<p>[1] <a href="https:&#x2F;&#x2F;regauth.standards.ieee.org&#x2F;standards-ra-web&#x2F;pub&#x2F;view.html#registries" rel="nofollow">https:&#x2F;&#x2F;regauth.standards.ieee.org&#x2F;standards-ra-web&#x2F;pub&#x2F;view...</a>
评论 #14510767 未加载
评论 #14511780 未加载
评论 #14511026 未加载
skrebbelalmost 8 years ago
I really like the ideas behind ksuid (near the end of the article). However, two quotes:<p>&gt; <i>Those concerned with UUID collision in a properly-configured system would find their time better spent pondering far more probable events like solar flares, thermonuclear war, and alien invasion on their systems.</i><p>And then further down:<p>&gt; <i>A “custom” epoch is used that ensures &gt;100 years of useful life.</i><p>Wait, so the last 128 bits of a KSUID won&#x27;t get me in trouble before the sun explodes, but the first 32 bits (the timestamp) will cause trouble well before my grandkids die?<p>I really wonder why they didn&#x27;t reserve some more bits for the timestamp, if necessary at the cost of some less randomness. Could&#x27;ve made this stuff last for millenia at no extra collision risk, in practice.
评论 #14509819 未加载
评论 #14509712 未加载
评论 #14509417 未加载
评论 #14509649 未加载
评论 #14510692 未加载
评论 #14510068 未加载
mappualmost 8 years ago
There&#x27;s also &quot;ULID&quot; in this neo-UUID space: <a href="https:&#x2F;&#x2F;github.com&#x2F;alizain&#x2F;ulid" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;alizain&#x2F;ulid</a><p>48-bit timestamp plus 80 bits randomness, base32 encoding (no hyphens), and lexicographic sort order.
评论 #14510409 未加载
MichaelGGalmost 8 years ago
Why would you ever want to use UUID format, which only has 122 bits, versus just making a random 128 bit number? In which realistic scenario would simply reading 16 bytes from urandom not be fine and actually cause issues that removing 6 of those bits to identify the UUID type help?<p>Also, 32 bit timestamp + 128 random? I guess, but that sounds sort of overkill-ish - if you&#x27;re going to go to 20 bytes (and thus not fit in a DB&#x27;s UUID type, require more than 2 registers, etc.), why not make it 24 or 32 bytes and have a proper timestamp? Or if 32-bit timestamp is really acceptable, are you sure that 96-bits of randomness are not?
评论 #14511375 未加载
评论 #14511011 未加载
评论 #14510955 未加载
评论 #14582651 未加载
评论 #14510951 未加载
wolfgang42almost 8 years ago
Vaguely related story: I inherited a system which generates SSCCs to identify each box being shipped from a warehouse. These are supposed to be globally unique, and are generated from a company&#x27;s GS1 number (the same used for UPCs) plus another number which the company is supposed to make sure is unique. This particular system generated them on the client-side, based on the current timestamp in microseconds, with a random pause to prevent two computers from generating identical runs if they both printed labels at the same time. In a fairly small warehouse, this generated collisions about every six months or so. I instead changed the program to use an (already existing!) auto-increment column on the shared database, thus precluding any possibility of collision and making the program a lot faster since it was no longer delaying for a quarter-second per label (on shipments of 200+ boxes).
mnarayan01almost 8 years ago
Having 32 bits of 1-second resolution time and 128 bits of random payload makes the idea that these are &quot;semi-sortable&quot; a bit odd. Consider:<p>1. Let&#x27;s be super-lenient and say that we&#x27;ll consider an <i>average</i> size bucket of up to 64k (2^16) equivalent entries to be &quot;semi-sortable&quot;.<p>2. If you generate anymore than 2^48 (2^32 * 2^16) IDs over the full 100ish year lifetime of the ID, then your giving up on even that super-lenient definition of &quot;semi-sortable&quot;.<p>3. If you&#x27;re only ever going to generate 2^48 IDs, then 2^128 bits of random payload (in addition to the 32 bits of timestamp!) seems like absurd overkill.<p>Given the amount of thought that obviously went into this, I&#x27;m guessing that there&#x27;s probably a good reason that they decided to go with 32 bit timestamps (I can certainly think of many, SHA1 length assumptions being a likely component), but if it&#x27;s in the article, I missed it.
smailialmost 8 years ago
It&#x27;s a little buried, but here&#x27;s the primary tldr of their KSUID library:<p>&gt; Thus KSUID was born. KSUID is an abbreviation for K-Sortable Unique IDentifier. It combines the simplicity and security of UUID Version 4 with the lexicographic k-ordering properties of Flake. KSUID makes some trade-offs to achieve these goals, but we believe these to be reasonable for both our use cases and many others out there.
cat199almost 8 years ago
Related tangent:<p>Anyone have any Domain&#x2F;OS stories or resources they want to share?<p>This system always seemed like an interesting one, but details are fairly scarce..
Valodimalmost 8 years ago
&gt; However, on a mobile device, almost anything goes: mobile devices cannot be trusted. While most of these are just as good as what’s available in the scenario above, it’s routine that the PRNG source on these devices isn’t very random at all. Given that there’s no way to certify the quality of these, it’s a big gamble to bet on mobile PRNGs. ID generation on low-trust mobile devices is an interesting and active area of academic research[1].<p>This is true for highly specialized systems like sensor nodes maybe. For what is generally understood as a &quot;mobile device&quot;, i.e. mobile phones or tablets, it is bollocks.
odbol_almost 8 years ago
&gt; It borrows core ideas from the ubiquitous UUID standard, adding time-based ordering.<p>Isn&#x27;t time-based ordering bad, since it might allow hackers to predict UUID generation and use it to compromise security systems based on UUID?
gumbyalmost 8 years ago
The phone number was hardly the &quot;first unique identifier in a network&quot; and switchboards worked just fine before phone numbers; phone numbers were first added in the 1890s because of the Stronger switch.<p>The first UUIDs in networks were probably titles (nobility or job titles in a byzantine empire like China, Russia or, less, the Ottoman Empire). &quot;Chief Assistant to the Assistant Chief of Shipbuilding&quot; is a unique node identifier (doesn&#x27;t identify a person, but then again phone numbers are reused too).
rphlxalmost 8 years ago
&#x2F;dev&#x2F;urandom is a major liability on any machine with low uptime booted for the first time from a widely-used image (i.e. a VPS), and on embedded systems which have few sources of entropy &amp; do not (or cannot) save&#x2F;restore it across boots. As a result there can be a much higher than pure-random chance of a collision in the &quot;random&quot; portion of a UUID.
danielbankheadalmost 8 years ago
Created something similar called &quot;bronze&quot;. It tackles the problem of creating unique identifiers at a slightly different angle, while allowing high collision resistance:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;AltusAero&#x2F;bronze" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AltusAero&#x2F;bronze</a>
tuupolaalmost 8 years ago
Since am big fan of everything Base62 I started to work on a PHP implementation of KSUID.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;tuupola&#x2F;ksuid" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tuupola&#x2F;ksuid</a>
gnu8almost 8 years ago
Is 996238e1-28d1-4b53-b81b-beae25f8edde working for anyone?
评论 #14512099 未加载
foreigneralmost 8 years ago
At first I read this as &quot;A Brief History of the IUD&quot; - that&#x27;s not the same thing at all :-)