News for hackers. Stuff that matters.
Re:You Don't Need UUID by iaaan on Monday September 11, 2023 @01:19PM (#37470412)
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 by Alupis on Monday September 11, 2023 @01:24PM (#37470501)
> Does it make the URL in the URL bar longer? Yeah, but does that matter?

No, it doesn't.

If you're using a central system to generate id's (UUID's or other), then you are indeed missing a lot of the benefits of UUID's and might as well use some other ID scheme.

The benefits of UUID are many systems can generate them, and your database can eventually accept them, all with a very high guarantee of uniqueness/no-collisions. Not to mention the other nice bits like non-sequential and non-enumerability.

Most modern databases have UUID/Binary types/functions to allow for more efficient storage/handling anyway.

Re:You Don't Need UUID by crooked-v on Monday September 11, 2023 @01:34PM (#37470647)
For a simple practical example, it's awfully useful for a lot of systems to be able to generate UUIDs in an app while offline (think document creation, etc) and reconcile things later by shooting the blob of content off to the server, while knowing that you only need to handle the dance of getting IDs and updating stuff locally again in your error handling case.
Re:You Don't Need UUID by emodendroket on Monday September 11, 2023 @01:28PM (#37470548)
That’s an excellent point; that can end up being a bottleneck across many systems.
Re:You Don't Need UUID by refulgentis on Monday September 11, 2023 @02:43PM (#37471760)
What can?
Re:You Don't Need UUID by marginalia_nu on Monday September 11, 2023 @03:01PM (#37472075)
Unique ID generation.
Re:You Don't Need UUID by emodendroket on Monday September 11, 2023 @03:35PM (#37472576)
A service responsible for handing out UIDs.
Re:You Don't Need UUID by i_am_jl on Monday September 11, 2023 @01:32PM (#37470619)
>Yeah, but does that matter?

I'm really reaching here, but an ID that omits special characters is easier to extract from a url, since it can be double-clicked in a URL bar to select it, whereas a GUID with hyphens forces the user to select the beginning and the end of the string.

Realistically I think this matters to developers more than users (I hope your application doesn't force users to interact with GUIDs in the address bar) but that's the only "waste" I can identify.

EDIT: Someone elsewhere noted that they can base64 encode their GUIDs to achieve this and I'm seething that I'd never thought to do that

Re:You Don't Need UUID by noisem4ker on Monday September 11, 2023 @01:43PM (#37470780)
To select an UUID, double click the first segment and drag the selection till the last segment before releasing. No need to aim for the exact beginning and end characters.

(Maybe that's what you meant, amd yes, it's still clunkier than simply double clicking, but not much)

Re:You Don't Need UUID by dheera on Monday September 11, 2023 @01:44PM (#37470805)
> easier to extract from a url, since it can be double-clicked

Maybe the double-click logic needs to be less stupid then. Or have it progressive, e.g. double-click = alphanumeric, triple-click = stop at symbols, quadruple-click = stop at slashes only, quintiple-click = the whole URL.

Use the device microphone to listen for swear words and adjust algorithm with machine learning accordingly

Re:You Don't Need UUID by tombert on Monday September 11, 2023 @01:46PM (#37470826)
As you said in your edit, you can of course base64 the GUID, but also don't most GUID libraries have an option to just omit the hyphens? I know .NET allows you to do that, and even correctly parse GUIDs that don't have any hyphens.

I usually did that in .NET simply because I thought it was prettier without the hyphens.

Re:You Don't Need UUID by tzot on Monday September 11, 2023 @01:47PM (#37470856)
> I'm really reaching here, but an ID that omits special characters is easier to extract from a url, since it can be double-clicked in a URL bar to select it, whereas a GUID with hyphens forces the user to select the beginning and the end of the string.

The is-hyphen-part-of-a-word issue depends on the text control (browser, UI widget library, …) / terminal you use, which is not universal.

In any case, the hyphens/dashes are not required part of the representation, and one can use the “dashless” representation (exactly 32 hex digits) in URLs and in-code without any issues whatsoever, as far as I know; for example, Postgres accepts either “dashful” or “dashless” UUIDs the same.

Re:You Don't Need UUID by thaurelia on Monday September 11, 2023 @01:39PM (#37470739)
> Yeah, but does that matter?

It might, e.g. with embedded systems. I can neither confirm nor deny that we once BOFed our own devices because we assumed that 1200 bytes was a big enough buffer to hold a URL.

Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @01:22PM (#37470460)
It matters aesthetically. A huge site like AWS might care about that, otherwise it's not a real priority.
Re:You Don't Need UUID by eternityforest on Monday September 11, 2023 @01:25PM (#37470513)
It somewhat matters aesthetically, but mostly people are going to ignore long random strings.

UUIDs are at least visually kind of white noise, companies have no problem+with+links?that=look&like=this, so why do they care about UUIDs?

Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @01:33PM (#37470638)
Cause some links are more likely to be shared, meaning they'll appear in a comment or SMS rather than just in your URL bar. Like if I copy a link from YouTube: https://www.youtube.com/watch?v=00Uw9kgZ4QM
Re:You Don't Need UUID by bandergirl on Monday September 11, 2023 @01:33PM (#37470633)
apple.com/iphone

You can't beat that. Or would you rather receive texts that include the following?

    https://www.amazon.com/dp/B09V3HZ8B5/?pd_rd_w=DAycy&content-id=amzn1.sym.04e31e32-5e01-4048-8b59-a557891d595f:amzn1.sym.04e31e32-5e01-4048-8b59-a557891d595f&pf_rd_p=04e31e32-5e01-4048-8b59-a557891d595f&pf_rd_r=M1KXM468KNZJV189JBE7&pd_rd_wg=3O1uC&pd_rd_r=e51c1edc-213f-4c6d-b081-e23afa6bf4ab&ref_=vn_s_iwp&qid=1694453553

> companies have no problem+with+links?that=look&like=this

Let's not match the lowest common denominator, shall we?

Re:You Don't Need UUID by blowski on Monday September 11, 2023 @01:40PM (#37470746)
[delayed]
Re:You Don't Need UUID by 5e92cb50239222b on Monday September 11, 2023 @01:35PM (#37470666)
You only really need this part:

https://amazon.com/dp/B09V3HZ8B5

Re:You Don't Need UUID by bandergirl on Monday September 11, 2023 @02:00PM (#37471037)
Yes but that's irrelevant, I used a real URL that you will receive in your texts. It's real life, it happens and it sucks. Let's not normalize it.
Re:You Don't Need UUID by traceroute66 on Monday September 11, 2023 @02:20PM (#37471351)
No. It's not irrelevant.

As you have been told apple.com/iphone = www.amazon.com/dp/B09V3HZ8B5

The rest of what you posted on the Amazon link is tracking bullshit. Now, THAT is irrelevant !

Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @03:59PM (#37472806)
Users aren't expected to manipulate URLs by hand. I go to Amazon and search a product. I want to share it with a friend, so I copy the URL. I don't bother figuring out the strictly necessary piece through trial and error and stripping out the rest, especially on a phone.

So the message to my friend says: https: //www.amazon.com/Hydro-Flask-Around-Tumbler-Trillium/dp/B0C34XR1LQ/?_encoding=UTF8&ref_=af_gw_DCC_hydro&pd_rd_w=aSsYb&content-id=amzn1.sym.0936cc94-1410-4d65-a169-26f5b2e3f58d&pf_rd_p=0936cc94-1410-4d65-a169-26f5b2e3f58d&pf_rd_r=KEW8KYVYZR1667D2K24C&pd_rd_wg=XO3RL&pd_rd_r=ece2c975-ab9c-4515-93db-ba40fe9624a1

Maybe Amazon doesn't care so much because sharing isn't super frequent. YouTube and Twitter have much shorter URLs.

Re:You Don't Need UUID by eternityforest on Monday September 11, 2023 @06:25PM (#37474534)
I wonder if this is something Unicode could address. You could have something like quote marks that mean "Anything between these is data that shouldn't be seen in digital media but should be printed"

So you could have urls like:

example.com?<a single icon>&productname=somethinghumanreadable

Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @06:53PM (#37474782)
The browser would also have to understand not to copy that part by default. But HTTP disallows unicode chars in URLs. There could instead be some "sharable URL" web API, but it seems like a small enough problem that sites are content just providing a custom share button if needed.
Re:You Don't Need UUID by insanitybit on Monday September 11, 2023 @01:46PM (#37470825)
Apple doesn't need to create pages for millions of arbitrary items for sale.
Re:You Don't Need UUID by bandergirl on Monday September 11, 2023 @01:59PM (#37471029)
The point is that you can always always always do better than a 100-character URL.
Re:You Don't Need UUID by skybrian on Monday September 11, 2023 @01:30PM (#37470586)
Some of us will strip off the crud to get the base URL, to avoid being tracked.
Re:You Don't Need UUID by NBJack on Monday September 11, 2023 @01:24PM (#37470500)
Agreed. Decorative URL slugs have been successfully used by everything from blogs to Amazon itself for over a decade. If anything, that should be the focus here. Short URLs aren't much of a help, especially when short is relative on something like a mobile device.
Re:You Don't Need UUID by croes on Monday September 11, 2023 @01:31PM (#37470606)
>Does it make the URL in the URL bar longer? Yeah, but does that matter?

Nowadays many links are much longer because of referrer information and tracking parameters. So the UUID doesn't add much.

Re:You Don't Need UUID by dspillett on Monday September 11, 2023 @01:55PM (#37470975)
They might if several sets of tracking information end up there, because people are blocking the cookies they might otherwise be in for instance, and each set of tracking info has an identifier or few. The length of UUIDs will multiply up quite quickly there.

Not that people will care. Once a URL is longer than a few words plus a code most users won't even look, even if they bother that far. You'll be in danger of starting to hit some browser/server/proxy limits though.

Not that I mind that sort of information being lost, I'm happy for the incessant tracking of everyone's everything these days needs to go to hell.

Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @05:33PM (#37474023)
I noticed a recent change on YouTube where the "share" button now includes extra tracking stuff, making it longer than the actual URL in the address bar. Which is even funnier considering that they bought the youtu.be domain just to make shared URLs shorter.

Address bar: https://www.youtube.com/watch?v=SHWhKRKlG98

Share button: https://youtu.be/SHWhKRKlG98?si=gwQHHze3UnjTobJg

Re:You Don't Need UUID by richbell on Monday September 11, 2023 @01:22PM (#37470461)
> Does it make the URL in the URL bar longer? Yeah, but does that matter?

Yes. That's one of the author's arguments.

) 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 an user’s perspective.

Re:You Don't Need UUID by dragonwriter on Monday September 11, 2023 @01:32PM (#37470618)
The point of a UUID is to have a unique machine ID that can be generated in parallel by separate, non-synchronized processes.

You don't need to make it a user exposed identifier, and you can have a centralized (but out-of-the-critical-path) process assigning friendly IDs if you can afford visibility delays (for either the whole item or at least the friendly ID, which if it is the only user-facing locator may mean that the individual item can’t be directly accessed even if it is visible in aggregates, until that is assigned; if you allow access by both the UUID and the friendly ID, with the latter presented as preferred once available, this is resolved but this may appear messier.)

Re:You Don't Need UUID by Turing_Machine on Tuesday September 12, 2023 @11:04AM (#37482387)
Exactly. Also, not everything is going to be an URL, or human-visible at all.

Others have noted the usefulness of generating ids for user-created data without involving the server, while being able to post that data at a later time without worrying too much about collisions.

Suspenders-and-belt practice would of course dictate that the server do some type of collision detection and mitigation before storing the received data.

    If UUID exists in database and user ID is different, tell client "Yo, we've got a collision here. Your new ID for this data is blah".
On the client end, when creating the data,

    Generate new UUID. If I've ever used that UUID before, generate a new one.
When the client saves the data to the server

    If the server rejects my UUID, switch to the new one provided by the server
In practice the collision mitigation code is likely never to be called, even in a very large system. The people who designed UUID went to great lengths to ensure that.

Personally, I'd look on home-brewed solutions for generating unique "friendly ids" with the same deep suspicion I look at home-brewed crypto, particularly if this were done client-side for multiple clients without involving a server round-trip. Getting it right is a Hard Problem. The perceived complexity of UUIDs is there precisely because it is a Hard Problem.

Re:You Don't Need UUID by appletrotter on Monday September 11, 2023 @01:26PM (#37470515)
Maybe it’s one if the author’s arguments, but that doesn’t mean the author is right.
Re:You Don't Need UUID by richbell on Monday September 11, 2023 @01:28PM (#37470552)
Sure — it's just a weird question to pose when the author specifically provides their opinion on it. It'd be different to say "I don't think it matters".
Re:You Don't Need UUID by Petersipoi on Monday September 11, 2023 @01:39PM (#37470727)
You're just nitpicking.

"Does it matter" is a very reasonable response to someone expressing their opinion.

Re:You Don't Need UUID by richbell on Monday September 11, 2023 @03:47PM (#37472659)
It's not nitpicking.

If I say "x matters and here's why" and you respond "yeah but does x matter?", you're either not paying attention or being rude and dismissive.

Re:You Don't Need UUID by NBJack on Monday September 11, 2023 @01:27PM (#37470541)
There is the rub. Readable for what purpose? Aesthetics? And why? It is meaningless in their example.

And what do they mean with communication? Reading it aloud? If the URL is too long to stick in a tweet or message, there are plenty of URL shorteners out there.

Re:You Don't Need UUID by skybrian on Monday September 11, 2023 @01:35PM (#37470678)
Copying very long URL’s into a Markdown document or a social media post is pretty annoying. URL shorteners are opaque and add a point of failure.

On link-sharing sites like this one, we care about the URL’s we share and will often strip off the tracking stuff.

Re:You Don't Need UUID by croes on Monday September 11, 2023 @01:30PM (#37470579)
Must be oral communication, otherwise copy and paste the link.

And I bet that for most users 3c6n63N is as confusing as a73ba12d-1d8b-2516-3aee-4b15e563a835

Re:You Don't Need UUID by insanitybit on Monday September 11, 2023 @01:47PM (#37470847)
I guess in the rare instance where you're literally reading a URL out loud it would help. Most of the time you're sending a URL, at which point length is mostly irrelevant as you're "copy/paste" on both sides.
Re:You Don't Need UUID by AdamH12113 on Monday September 11, 2023 @01:48PM (#37470867)
> Does it make the URL in the URL bar longer? Yeah, but does that matter?

I appreciate shorter URLs any time I copy and paste them, which always involves looking at them and sometimes involves scrolling to the end to remove tracking- and search-related fluff.

128 bits is an absurd amount for a unique ID within a single system. Even 48 bits is very, very large -- enough to provide a unique ID (MAC address) to every Ethernet device made for something like 100 years.

The purpose of a UUID is to provide a negligible probability of collisions between randomly-generated IDs in a global space forever. Almost no applications require that, so most of the time using a UUID is just needlessly taking up space.

Re:You Don't Need UUID by siva7 on Monday September 11, 2023 @02:03PM (#37471085)
That’s not the only major purpose for a UUID and even if it was, it still would be flat out wrong to claim that almost no application requires that.
Re:You Don't Need UUID by AdamH12113 on Monday September 11, 2023 @03:43PM (#37472608)
Maybe I'm missing something, then? I'm having trouble thinking of applications where it seems like a good idea to generate a permanent ID number completely randomly at all, much less applications that need to let the whole world do so. I can see how Windows device drivers have that requirement, but the point of the article is that even a massive site like YouTube (which doesn't want videos to be randomly discoverable via URL manipulation) does not need anywhere close to 128 bits. What are these applications you speak of?
Re:You Don't Need UUID by paulddraper on Tuesday September 12, 2023 @03:55PM (#37487144)
The purpose of a universally unique identifier was indeed to be universally unique.
Re:You Don't Need UUID by hot_gril on Monday September 11, 2023 @02:46PM (#37471807)
Basically, you want UUID's 122 bits (128 minus 6 wasted on variant + version) if you can't afford collisions. If you have some DB enforcing unique IDs at creation time, you can manage with a lot fewer bits if you want shorter URLs or something.
Re:You Don't Need UUID by marginalia_nu on Monday September 11, 2023 @03:05PM (#37472125)
> 128 bits is an absurd amount for a unique ID within a single system. Even 48 bits is very, very large -- enough to provide a unique ID (MAC address) to every Ethernet device made for something like 100 years.

What you want is that the number of possible items to enumerate is significantly less than the square root of the cardinality of the ID range, means you can relatively safely randomly generate IDs with few collissions.

Re:You Don't Need UUID by paulddraper on Tuesday September 12, 2023 @03:54PM (#37487120)
> these aren't situations I've ever found myself in

You've never needed to give an order number, member ID, account ID, invoice number, etc?