Skip to content

resource identifiers

Peter Van den Bosch edited this page Jun 30, 2021 · 7 revisions

Requirements

A resource identifier should be stable over time, i.e. should not change when properties of the resource change, nor should it point to different resources over time.

Furthermore, one or more of following requirements may apply when designing resource identifiers, according to use case:

  • easy to memorize (e.g. textual identifier like problem types)
  • input by user (e.g. web form, over phone/mail)
    • easy to type (ignore special separator chars, difference between lower/capital case), limited length
    • validation of typing errors, e.g. by checksum, fixed length, ...
    • hint on format to recognize purpose of identifier based on its value
  • printable (length restricted)
  • evolvable structure
  • generate identifiers at multiple independent sources (e.g. prefix by source, uuids, ...)
  • stable across different deployment environments (e.g. problem type codes)
  • hide any business information (e.g. no sequential number that indicates number of resources created)
  • easy to represent in URL parameter
  • sortable (for technical reasons e.g. pagination)

Options

  • string-based
    • UUID
    • URI
    • enum of values
    • unconstrained, regexp pattern, fixed/max length, ...
  • integer
    • unconstrained, min/max value, ...