Practical developer guides

UUID, ULID and Nano ID: choose an identifier by requirements

Compare portability, ordering and randomness without mistaking an identifier for authorization.

Nav Tools ·

Start with requirements

An identifier may need standard interoperability, compact representation, ordering or opaque randomness. Those goals can conflict.

Choose a supported format before choosing string length. Existing database types, API clients and downstream systems may already assume UUID syntax.

UUID: 550e8400-e29b-41d4-a716-446655440000
This is a public example identifier, not a credential.

Know the UUID version

UUID versions have different generation properties. Version 4 is random, while time-oriented versions have different ordering and information characteristics.

Use UUID Inspect to identify a supplied version. Do not assume a tool implements every RFC version merely because it generates UUIDs.

Ordering has limits

ULID includes a timestamp component and a random component. Lexicographic order can be useful, but clock behavior and same-time generation need consideration.

Nano ID emphasizes a configurable compact random representation. Changing the alphabet or length changes collision characteristics and interoperability.

Enforce uniqueness and access separately

Random generation reduces collision probability but does not mathematically guarantee no duplicates. Keep an appropriate database uniqueness constraint.

Knowing or guessing an ID must not grant access. Apply authorization independently, and account for timestamp information when exposing time-oriented identifiers.

References

← Practical developer guides