Permanent Identifiers

We need identifiers for publication groups, publisher editions, and impression groups that can easily be shared and be part of a URL.

Natural keys are problematic because the data might need to be updated, so surrogate keys are more suitable. An incrementing integer is problematic however, because it implies an ordering.

We have settled on random four-character base30 identifiers. The base30 involves 23456789ABCDEFGHJKMNPQRSTVWXYZ, which eliminates characters that might be confused with one another. To reduce the chance of misparsing in formats such as YAML, we furthermore constrain the uid to start with a letter.

Four characters were chosen as it makes the identifiers short enough to be easily communicated verbally or typed into chats, etc.

This leaves us 594,000 values, which is more than enough for the entities in our system.

The URL https://books.digitaltolkien.com/<UID>/ is intended to be the permanent URI for the entity.

Every one of them now resolves. A publication group's uid serves the ISBN's own page, listing the publisher editions issued under that number; a publisher edition's uid serves the edition, with its format, market, tags, numbering and the impression groups that printed it; and an impression group's uid serves the printing, as it always has. Boxed sets share the same space. Nothing distinguishes the four kinds in the URL, which is the point: a uid is an address, and what is found there is whatever the identifier names.