UUID, ULID, and NanoID
- What is a UUID?
A universally unique identifier (UUID) is a 128-bit label used for information in computer systems. The term globally unique identifier (GUID) is also used.
- Version 1: date-time and MAC address
- Version 2: date-time and MAC address, DCE security version
- Versions 3 and 5: namespace name-based
- Version 4: random
- Version 6: If you're looking for a spacial UUID that is optimized for clustered indices, consider Uuid6 as a viable option.
A UUID looks like this:
123e4567-e89b-12d3-a456-426614174000
- What is a ULID?
The ULID, which stands for "Universally unique Lexicographically sortable IDentifier", is an alternative to the UUID.
It is a 26-character string (128 bits) comprised of ten timestamp characters that provide millisecond precision and sixteen randomly generated characters.
A ULID looks like this:
01ARZ3NDEKTSV4RRFFQ69G5FAV
ULID spec is hosted in GitHub if you would like to know more in details.