Live data from Hacker News

Choosing between names and identifiers in URLs

cloudplatform.googleblog.com

31–40 of 157 posts

Re: Choosing between names and identifiers in URLs

#31

"The downside of the second example URL is that if a book or shelf changes its name, references to it based on hierarchical names like this one in the example URL will break." The author appears to have forgotten about 3xx redirection codes which were intended to solve that very problem.

But have been abused for black SEO and now are considered suspicious by search engines so we use them sparingly.

This is why we can't have nice things.

Re: Choosing between names and identifiers in URLs

#32
post #17

Earlier quoted context omitted.

and your comment is the perfect demonstration why: when truncated, the id gets cut off before the slug.

Which is... something you don't want to happen, right?

Right, I was thinking purely display truncation, like here. Surviving copy-paste from here or other actual truncation it's bad, true.

Re: Choosing between names and identifiers in URLs

#33
post #27
post #19

Earlier quoted context omitted.

Doing this means that: 1) there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services (mitigated for only some kinds of service if you redirect to correct), 2) if the title changes the URLs distributed are now permanently wrong as they stored part of the content (and if you redirect to correct, can lead to temporary loops due to caches), 3) the URL is now…

> there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services What services? Web crawlers? I'm sure the ones I would care about are smart enough to know how this works. There are many ways infinite valid URLs can be made. Query params, subdomains and hashroutes to name a few. > if the title changes the URLs distributed are now permanently wrong as they st…

I don't have a direct piece of evidence, but most users don't even know about ctrl-f, so I think they don't copy and paste. They click (or tap, these days) on links. https://www.theatlantic.com/technology/archive/2011/08/crazy...

Most users click links.

Re: Choosing between names and identifiers in URLs

#34
The article talks about referring to resources by using URLs containing opaque ID numbers versus URLs containing human-readable hierarchical paths and names. They give examples like bank accounts and library books.

This problem about naming URLs is also present in file system design. File names can be short, meaningful, context-sensitive, and human-friendly; or they can be long, unique, and permanent. For example, a photo might be named IMG_1234.jpg or Mountain.jpg, or it can be named 63f8d706e07a308964e3399d9fbf8774d37493e787218ac055a572dfeed49bbe.jpg. The problem with the short names is that they can easily collide, and often change at the whim of the user. The article highlights the difference between the identity of an object (the permanent long name) versus searching for an object (the human-friendly path, which could return different results each time).

For decades, the core assumption in file system design is to provide hierarchical paths that refer to mutable files. A number of alternative systems have sprouted which upend this assumption - by having all files be immutable, addressed by hash, and searchable through other mechanisms. Examples include Git version control, BitTorrent, IPFS, Camlistore, and my own unnamed proposal: https://www.nayuki.io/page/designing-a-better-nonhierarchica... . (Previous discussion: https://news.ycombinator.com/item?id=14537650 )

Personally, I think immutable files present a fascinating opportunity for exploration, because they make it possible to create stable metadata. In a mutable hierarchical file system, metadata (such as photo tags or song titles) can be stored either within the file itself, or in a separate file that points to the main file. But "pointers" in the form of hard links or symlinks are brittle, hence storing metadata as a separate file is perilous. Moreover, the main file can be overwritten with completely different data, and the metadata can become out of date. By contrast, if the metadata points to the main data by hash, then the reference is unambiguous, and the metadata can never accidentally point to the "wrong" file in the future.

Re: Choosing between names and identifiers in URLs

#35
post #4

Good advice. Interesting that Canonical URLs aren't mentioned. But the sheer arrogance of serving a webpage that doesn't render any text unless you execute their JavaScript really annoys me. It's not a fancy interactive web-app, it's a webpage with some text on it.

Loaded just fine with NoScript here.

Re: Choosing between names and identifiers in URLs

#36
http://journals.plos.org/plosbiology/article?id=10.1371/jour...

Abstract

In many disciplines, data are highly decentralized across thousands of online databases (repositories, registries, and knowledgebases). Wringing value from such databases depends on the discipline of data science and on the humble bricks and mortar that make integration possible; identifiers are a core component of this integration infrastructure. Drawing on our experience and on work by other groups, we outline 10 lessons we have learned about the identifier qualities and best practices that facilitate large-scale data integration. Specifically, we propose actions that identifier practitioners (database providers) should take in the design, provision and reuse of identifiers. We also outline the important considerations for those referencing identifiers in various circumstances, including by authors and data generators. While the importance and relevance of each lesson will vary by context, there is a need for increased awareness about how to avoid and manage common identifier problems, especially those related to persistence and web-accessibility/resolvability. We focus strongly on web-based identifiers in the life sciences; however, the principles are broadly relevant to other disciplines.

claimer: I am one of the many authors.

Re: Choosing between names and identifiers in URLs

#37
post #3

Great post - I quite like the stackoverflow.com style of `stackoverflow.com/questions/ / `, where can be changed to anything, and the link still works. This allows for easy URL readability, while also having a unique ID. In the context of this post (the library example) that would look like library.com/books/1as03jf08e/Moby-Dick/

This seems like it's vulnerable to some form of abuse. library.com/books/1as03jf08e/Moby-Dick/ library.com/books/1as03jf08e/Hitchhikers-Guide-to-the-Galaxy Now lead to the same place...

You would redirect to the canonical one.

Re: Choosing between names and identifiers in URLs

#40
post #27

Earlier quoted context omitted.

> there are now an infinite number of URLs for every one of your pages that may end up separately stored on various services What services? Web crawlers? I'm sure the ones I would care about are smart enough to know how this works. There are many ways infinite valid URLs can be made. Query params, subdomains and hashroutes to name a few. > if the title changes the URLs distributed are now permanently wrong as they st…

I don't have a direct piece of evidence, but most users don't even know about ctrl-f, so I think they don't copy and paste. They click (or tap, these days) on links. https://www.theatlantic.com/technology/archive/2011/08/crazy... Most users click links.

I meant in the context of sharing links, either on a board like this or in a text. But that does bring a up a good point of how many users know how to copy/paste?

Among all internet users, I would conservatively assume 30%+ do. Among people who have posted a link to social media or forums, I would assume %80+. But I'd be interested to see how off I am.

Post reply on HN