Live data from Hacker News

You Don't Need UUID

henvic.dev

181–190 of 199 posts

Re: You Don't Need UUID

#181
post #119

IMO, a good middleground is using schemes like TypeID[0], ulid[1], or KSUID[2] that provides a more compact and readable (base32) representation and provides better database locality (K-sortable). [0] https://github.com/jetpack-io/typeid [1] https://github.com/ulid/spec [2] https://github.com/segmentio/ksuid

Isn't UUIDv7 K-sortable?

Re: You Don't Need UUID

#182
post #155
post #119

IMO, a good middleground is using schemes like TypeID[0], ulid[1], or KSUID[2] that provides a more compact and readable (base32) representation and provides better database locality (K-sortable). [0] https://github.com/jetpack-io/typeid [1] https://github.com/ulid/spec [2] https://github.com/segmentio/ksuid

I'm recently finding Cuid2 to be the best of these alternative GUIDs. They seem to have all of the benefits for what you would want to use a GUID for, but none of the drawbacks of existing implementations.[1] [1]: https://github.com/paralleldrive/cuid2#comparisons

Cuid2 is explicitly not K-sortable, no?

Re: You Don't Need UUID

#183
post #54

Earlier quoted context omitted.

Plus I could easily represent UUID in base64, such as JlEt5BSYe0enwB7nxl5V6g, which makes it shorter if I need that.

or ascii85: -;cAU'UX5;VnaA:`a2[1

I can't even get people to distinguish between a forward and backslash... :-(

Re: You Don't Need UUID

#184

> A simple ID like 3c6n63N is more than enough to represent any product while keeping it readable and making communication easier. A UUID alternative like a73ba12d-1d8b-2516-3aee-4b15e563a835 is just wasteful from a user’s perspective. I would challenge the premise we appear to be starting from, that the average end user cares to be dealing with any random string of numbers and digits. GUIDs work well, they’re implem…

I like your thinking, but somehow fear that at some point in time in the future I'll get an ID like "S5o0QlI1" and my brain will automatically eject itself from my skull in disgust.

Re: You Don't Need UUID

#185
No comments on this page about Snowflake IDs.

https://en.wikipedia.org/wiki/Snowflake_ID

They fit within 64 bits, allow for more than enough processes to handle 10k+ transactions per second, give enough of a timestamp headroom for decades into the future, and where ID generation can be made isolated to each process.

They don't work well for anything related to archival work, but you might as well use a regular ID for that anyway, unless you're also actively scraping terabytes of data off of the Internet every second, in which case UUIDv5's good enough for your extreme edge case.

...But at that point you might as well just roll your own 128-bit version of a Snowflake ID.

Re: You Don't Need UUID

#186
post #54

Earlier quoted context omitted.

Plus I could easily represent UUID in base64, such as JlEt5BSYe0enwB7nxl5V6g, which makes it shorter if I need that.

or ascii85: -;cAU'UX5;VnaA:`a2[1

Yikes! I wouldn't want to provide that as a shell argument.

Re: You Don't Need UUID

#187
post #122

Earlier quoted context omitted.

I see bad url design for other reasons but nothing wrong with UUIDs, so no it doesn’t help me see the argument.

What do you mean by bad url design? Because it's using UUIDs? That was my point.

Not OP but it's obvious to me that by bad url design, they mean that you could have used usernames and issue numbers in the URL but you chose to go with random IDs where there was no need for it.

Re: You Don't Need UUID

#188
post #74

> A UUID alternative like a73ba12d-1d8b-2516-3aee-4b15e563a835 is just wasteful from an user’s perspective. The argumentation in this article is pretty poor from my experience. A UUID isn’t meant to be handled by the non-technical end user. The end user usually doesn’t and shouldn’t care about the URL. I can assure there are bigger architectural problems in your design if your user has to care about accessible intern…

Does this help see what's wrong with UUIDs in URLs? A GitHub issue URL in a parallel universe: https://github.com/a73ba12d-1d8b-2516-3aee-4b15e563a835/e16957bf-7d7f-41f1-97f4-98c93a6c3540/issues/4e4e9133-bcdb-45b9-8dfe-9e951846e3c6

A fairer comparison would be that in that universe the url would be:

  https://github.com/4e4e9133-bcdb-45b9-8dfe-9e951846e3c6
or even

  urn:uuid:4e4e9133-bcdb-45b9-8dfe-9e951846e3c6
with the right infrastructure.

Re: You Don't Need UUID

#189
We need them tho. Especially UUIDv4 and UUIDv5. We have a distributed system and we manage permission identities with that. Each item that's supposed to be restricted has either of these ids. UUIDv4 for global things like workspaces and users, UUIDv5 for workspace-specific stuff (the workspace UUIDv4 is given as a namespace for the v5) and it's quite beautiful and prevents clashes. So it really depends on your usage. We still have long ids that are exposed to the client tho.

Re: You Don't Need UUID

#190
post #188

Earlier quoted context omitted.

Does this help see what's wrong with UUIDs in URLs? A GitHub issue URL in a parallel universe: https://github.com/a73ba12d-1d8b-2516-3aee-4b15e563a835/e16957bf-7d7f-41f1-97f4-98c93a6c3540/issues/4e4e9133-bcdb-45b9-8dfe-9e951846e3c6

A fairer comparison would be that in that universe the url would be: https://github.com/4e4e9133-bcdb-45b9-8dfe-9e951846e3c6 or even urn:uuid:4e4e9133-bcdb-45b9-8dfe-9e951846e3c6 with the right infrastructure.

Absolutely. The issue uuid should then be a UUIDv5 namespaced to the context and you only have one globally unique id. I think people just don't understand uuids properly and treat them as a "gives me some random thingy".
Post reply on HN