Replace serial entity IDs with UUIDs in URLs, or even globally?

Created on 12 August 2012, over 12 years ago
Updated 31 August 2024, 7 months ago

Background

Problem

  • Serial IDs are only useful within the scope of a single site, but lose their entire meaning in staging scenarios.
  • Menu links as well as reference fields (e.g., taxonomy term, file, image, ...) store the serial ID as value.
  • Links within content contain serial IDs and thus may point to a wrong target after being staged.
  • Serial IDs present collision problems with migration: #2748609: [meta] Preserving auto-increment IDs on migration is fragile

Goal

  • Make entity references compatible with content staging.

Proposed solution

  1. Replace serial IDs with UUIDs in reference field values.
  2. Replace serial IDs with UUIDs in URLs.

Details

  • Storage lookups for integer/serial IDs vs. string UUIDs should be identical performance-wise.
  • URL paths, such as /node/1637370, are not really any nicer than /node/4bd1c937-f530-456f-a218-241d7bfd40b8.
  • For backwards-compatibility, there could be URL aliases for the original serial IDs.

Related issues

Notes

  • Upgrade path will become quite complex, especially for in-text/content links.
  • http://drupal.org/project/uuid_redirect is a contrib attempt to use UUIDs in URLs.
  • Consider to remove the $entity_type argument from entity_load_by_uuid(), and introduce a global mapping table for UUID » entity_type mappings (required since entities live in different storages), so entities can be loaded through the UUID only.
Feature request
Status

Postponed

Component

Idea

Created by

🇩🇪Germany sun Karlsruhe

Live updates comments and jobs are added and updated live.
  • Needs architectural review

    The issue is available for high level reviews only. If there is a patch or MR it is not to be set to 'Needs work' for coding standards, minor or nit-pick changes.

  • API change

    Changes an existing API or subsystem. Not backportable to earlier major versions, unless absolutely required to fix a critical bug.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany c-logemann Frankfurt/M, Germany
  • 🇳🇿New Zealand quietone

    And years later the Ideas project is being deprecated. This issue is moved to the Drupal project. Check that the selected component is correct. Also, add the relevant tags, especially any 'needs manager review' tags. And check for duplicates. Thanks

Production build 0.71.5 2024