Modern systems increasingly require globally unique identifiers that scale horizontally across services, servers, and regions. Although we use integer primary key in most of the databases, in distributed systems developers think another way of handling primary keys using binary format.
Two modern alternatives for primary key:
-
ULID (Universally Unique Lexicographically Sortable Identifier)
-
UUIDv7 (a new, time-ordered UUID variant standardized in RFC 9562)
What the ULID and UUID7 offers:
-
Global uniqueness
-
Time-ordered identifiers
-
More index-friendly structure than UUIDv4
-
Compatibility with MySQL’s BINARY(16) storage
What is ULID?
ULID is a 128-bit identifier consisting of:
48 bits — timestamp 80 bits — randomness
ULID Benefits:
-
Sortable by creation time
-
Human-readable (26 characters)
-
Great for Big Data, Logs, APIs, distributed systems.
Example:
01J0MZF81Z8ZKP9E9F2X1YHVCN
What is UUID7?
UUIDv7 is part of the new UUID proposal (RFC 9562):
-
Time-ordered
-
Highly index-friendly
-
Compatible with existing UUID standards.
Example:Â
018f24e1-fa4c-7f4b-b497-f5c8d85b1d7a
Example Mysql Table:
The best practice is to store ULID and UUID7Â as BINARY(16):


