Live data from Hacker News

You Don't Need UUID

henvic.dev

1–10 of 199 posts

Re: You Don't Need UUID

#2
When it comes to random identifiers, the advantage of uuid4 is mainly that it's a standard thing that everyone understands well, and finding a lib that generates one securely won't require any thought. It's never the ideal solution, but it's often good enough.

Re: You Don't Need UUID

#3
The crux of this argument seems to be that UUIDs are too long? Which I disagree with. I can't memorize them, no, and it would be cumbersome to try to say one aloud, but these aren't situations I've ever found myself in.

Does it make the URL in the URL bar longer? Yeah, but does that matter?

Re: You Don't Need UUID

#4
> 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 implemented everywhere, and you won’t find out long after you go into production you made some mistake that is going to make it so you have to migrate away from them.

Re: You Don't Need UUID

#5
Sure, you don't need them, but why re-invent the wheel? At least UUIDs are not some one-off function in a helpers file that may need to be amended many times before you get it right, but are backed by a specification, are time-sortable, etc.

Re: You Don't Need UUID

#7
Use sequential IDs, but run them through a maximal linear feedback shift register.

They will be in a deterministic order, but will appear semi-random to the end user.

For things like product IDs or user IDs, etc you don't actually need them to be random. But perhaps you don't want them to simply start counting sequentially.

Re: You Don't Need UUID

#8
Isn't auto generating UUIDs "fast enough" in most situations that its negligible?

In particular databases (where UUIDs taking space was a big concern) they have largely switched to a packed binary format that makes the size of UUIDs over time a non issue for all practical purposes.

Re: You Don't Need UUID

#9
post #2

When it comes to random identifiers, the advantage of uuid4 is mainly that it's a standard thing that everyone understands well, and finding a lib that generates one securely won't require any thought. It's never the ideal solution, but it's often good enough.

Agreed - not to mention the specification of new ones with different features keeps evolving.

Re: You Don't Need UUID

#10
post #3

The crux of this argument seems to be that UUIDs are too long? Which I disagree with. I can't memorize them, no, and it would be cumbersome to try to say one aloud, but these aren't situations I've ever found myself in. Does it make the URL in the URL bar longer? Yeah, but does that matter?

It matters aesthetically. A huge site like Amazon might care about that, otherwise it's not a high priority.
Post reply on HN