Live data from Hacker News

ULID: Universally Unique Lexicographically Sortable Identifier

packagemain.tech

1–10 of 58 posts

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#3
Mentioned in the article's comments:

> Why not use UUID7?

> "ULID is much older than UUID v7 though and looks nicer"

For those unfamiliar, UUIDv7 has pretty much the same properties – sortable, has timestamp, etc.

ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV

UUIDv7: 019b04ff-09e3-7abe-907f-d67ef9384f4f

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#5
> It is worth noting that the newest proposed standard for unique identifiers, UUID v7, aims to address the sortability and database performance issues of older UUID versions by adopting a similar time-ordered structure to ULID.

Yeah, I would go with UUID v7 at this point given that it's part of the UUID RFC https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-vers...

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#6

Mentioned in the article's comments: > Why not use UUID7? > "ULID is much older than UUID v7 though and looks nicer" For those unfamiliar, UUIDv7 has pretty much the same properties – sortable, has timestamp, etc. ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV UUIDv7: 019b04ff-09e3-7abe-907f-d67ef9384f4f

UUIDv7 looks better in the eye of this beholder.

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#7

Mentioned in the article's comments: > Why not use UUID7? > "ULID is much older than UUID v7 though and looks nicer" For those unfamiliar, UUIDv7 has pretty much the same properties – sortable, has timestamp, etc. ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV UUIDv7: 019b04ff-09e3-7abe-907f-d67ef9384f4f

It’s also quite common to base62 the UUID value so in this case “31prI2bsccbXJB7cvbtV9”

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#8

Mentioned in the article's comments: > Why not use UUID7? > "ULID is much older than UUID v7 though and looks nicer" For those unfamiliar, UUIDv7 has pretty much the same properties – sortable, has timestamp, etc. ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV UUIDv7: 019b04ff-09e3-7abe-907f-d67ef9384f4f

UUID 7 is so much easier than the ULID in the article manipulate. Pretty much every language and database has the string manipulation and from_hex functions to extract the timestamps without any special support function. Whereas a format that is too clever is way more complicated to work with.

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#9
post #6

Mentioned in the article's comments: > Why not use UUID7? > "ULID is much older than UUID v7 though and looks nicer" For those unfamiliar, UUIDv7 has pretty much the same properties – sortable, has timestamp, etc. ULID: 01ARZ3NDEKTSV4RRFFQ69G5FAV UUIDv7: 019b04ff-09e3-7abe-907f-d67ef9384f4f

UUIDv7 looks better in the eye of this beholder.

I know it may sound stupid but in my latest project I chose ULIDs because I can easily select them as one word, instead of various implementations of browsers, terminals, DB guis, etc each have their own opinion how to select and copy the whole UUID. So from that point of view ULIDs "look" better for me as they are more ergonomic when I actually have to deal with them manually.

Re: ULID: Universally Unique Lexicographically Sortable Identifier

#10
Whenever ULID comes up, I need to remind that it has a sequential ID generation mode in its spec which is prone to conflicts on multi-threads, processes or hosts which kills the purpose of a "universal" identifier. If you need a sequential ID, just use an integer, preferably one that's autoincremented by the database.

It's best to stick to UUIDv7 because of such quirks of ULID.

Post reply on HN