ULID: Universally Unique Lexicographically Sortable Identifier
created: Dec. 1, 2025, 8:45 p.m. | updated: Dec. 10, 2025, 2:50 a.m.
Introducing the ULID IdentifierFew projects I worked on used the ULID (Universally Unique Lexicographically Sortable Identifier), and I really enjoyed working with it, and would love to share this experience with you.
ULID addresses the drawbacks of traditional UUID versions by focusing on four key characteristics:Lexicographically sortable.
When using ULID, the sort order is inherent in the ID itself, as demonstrated by the following database query output:select * from ulid_test where kind = 'ulid' order by id; 019aaae4-be9c-d307-238f-be1692b3e8d7 | ulid | 1 019aaae4-be9d-011f-b82e-b870ca2abe9d | ulid | 2 019aaae4-be9f-e9d7-6efc-5b298ecc572b | ulid | 3 019aaae4-bea0-deae-6408-d89e7e3ce030 | ulid | 4 019aaae4-bea1-8ed2-c2f5-144bb1ffedde | ulid | 5As we can see, the records are returned in the same order they were inserted.
Limitations and the futureThere’s really no major drawback to using ULID, but you should understand its limitations.
While other alternative identifiers exist, such as CUID or NanoID, the benefits of ULID have become a major factor in the evolution of unique identifier standards.
1 week, 3 days ago: Hacker News