EN
Back to the archive

The encyclopedia · Engineering & Operations · Technical decision · 1987-2005

UUID made a globally unique 128-bit ID that any machine can mint alone

UUID folded a timestamp, clock and node (or enough random bits) into 128 bits so each machine mints a unique ID with no registry.

Apollo Computer · Microsoft

the move

A database needs a primary key, but two systems that have never connected need to create keys that will never collide. The naive fix is a central authority that hands out numbered ids, which works only as long as everyone can reach it and is willing to queue behind it.

UUID solves this by making the ID big and self-describing. It is 128 bits. Version 1 uses the current 60-bit timestamp, a clock sequence and the generating machine's 48-bit node address; version 4 just uses 122 random bits. Both include a version field so future formats can be added without breaking older ones.

The insight is that the information needed for uniqueness is already available locally. Two machines using a timestamp plus their own address cannot produce the same value, so no coordinator is required.

why it works

  • The version and variant fields keep the format forward-compatible, so new ID schemes can be added without renumbering existing ones.
  • A 128-bit space with 122 random bits makes collisions astronomically unlikely, so v4 needs no clock or address at all.
  • Because the ID is opaque and locally generated, an API can accept it and route it without a lookup table.
  • Its origin in Apollo NCS and OSF DCE, then adoption into Microsoft Windows, seeded it into every language's standard library.
the payoffGive every machine a way to mint a unique ID alone.clever

what transfers

Uniqueness can be a local computation if the design packs enough independent entropy; you do not need a registry to issue IDs, which is what lets thousands of machines create keys offline.

what came after

UUIDs were standardized as RFC 4122 in 2005 and refreshed as RFC 9562 in 2024, adding time-ordered versions to fix index fragmentation. They are now the default identifier type in databases, message queues and distributed systems, though version 4's random ordering occasionally hurts B-tree performance.

references

spotted an error? The archive wants to know.

same kind of clever