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.