Starts with time, so it sorts naturally and helps database indexes.
ULID
26 characters, no hyphens, time-ordered and shorter in URLs.
When to use a unique ID instead of a sequence
Do
When merging data from several servers
In public URLs you do not want guessed
When the app creates a record before saving it
Avoid
Do not treat it as a secret or password
Do not use v4 as a primary key in huge tables without reason; v7 indexes faster
Example: an order number nobody can guess
If your order or invoice links use sequences like /order/1052, anyone can try 1053. A UUID in the link makes guessing impractical, though checking the user's access is still required either way.
Key terms
Short definitions of what you meet along the way.
UUID
A 128-bit identifier written in 36 characters, unique without a central authority.
ULID
A time-ordered 26-character identifier in Crockford Base32.
Primary key
The column that identifies each row in a database table.
We use necessary cookies to run the site, and Google Analytics to measure visits only if you agree. You can change your choice at any time from “Cookie settings”. Privacy policy