UUID

A 128-bit globally unique identifier — the standard primary-key choice for distributed systems.

Definition

A Universally Unique Identifier is a 128-bit value usually written as 32 hex digits with dashes (e.g. 550e8400-e29b-41d4-a716-446655440000). UUIDs avoid the coordination needed for auto-increment integers across distributed services. UUIDv4 is random; UUIDv7 (newer) embeds a timestamp so values sort chronologically, which is friendlier to databases.

When to use

See also