Three-lane database runway · identifiers done right
Choose the shape of insertion, leakage, and storage.
Identifier generation is one click. The architectural choice is whether values arrive randomly or broadly time-ordered, whether creation time is visible, and which native database representation your system can enforce.
UUID v4
RANDOM · SCATTERED
UUID v7
TIME · BUCKETED
ULID
LEXICOGRAPHIC · ALIGNED
Identifier passport
Bit anatomy switchboard
UUID v4 · 128 bits
UUID v7 · 128 bits
ULID · 128 bits
Sort-order race
Time-ordered does not mean globally sequential.
Unrelated to creation time
Random index arrival
Broadly chronological by millisecond prefix
Better temporal locality; same-ms order is generator-specific
Canonical text sorts by timestamp prefix
Monotonic factories can order same-ms values within one process
Storage decision matrix
Timestamp privacy window
Orderable IDs reveal when.
UUID v7 and ULID expose a millisecond timestamp. That can help operations and indexing, but it can also reveal object creation time and approximate activity. UUID v4 carries no defined timestamp.
Collision language contract
Extremely unlikely is not impossible.
Healthy cryptographic randomness makes accidental collisions negligible at ordinary scales. It does not remove the need for a unique constraint, retry path, and generator-quality monitoring where identity matters.
Normalization customs
URN prefix and braces may be inspected
lowercase, hyphenated canonical form
case-insensitive Crockford text accepted by the library
26 uppercase canonical characters
never invent timestamp provenance by relabeling random bits