AG UUID

What is a UUID

A ground-up overview of what a UUID (Universally Unique Identifier) is and why it is used.

Definition

A UUID is a 128-bit value designed to create identifiers that are almost never duplicated anywhere in the world, even without a central authority. It is usually written as 32 hexadecimal digits with 4 hyphens in an 8-4-4-4-12 pattern.

Why use it

Because multiple systems or offline environments can each mint IDs without colliding, UUIDs are widely used for distributed systems, database primary keys, file names, session tokens, and more. Unlike sequential integers, they are hard to predict and easy to merge.

Versions

UUIDs come in several versions. The random v4 is the most common, and the time-sortable v7 is the latest recommendation. There are also the name-based v3 and v5, the time-based v1, and the all-zero NIL.