Project note, July 2026: This post describes an identity boundary in the SoCalNomad NewsDesk pipeline.
An integer primary key is unique inside its table.
That last phrase is easy to forget.
NewsDesk consumed articles from two source tables created by different stages of the editorial pipeline. Both tables assigned ordinary incremental IDs. Record 42 could therefore exist in both places and refer to two unrelated articles.
A downstream cluster that stored only 42 had not preserved identity. It had preserved half of an address.
Local Identifiers Do Not Become Global By Convenience
The bug pattern appears whenever data from separate namespaces is combined:
- Two database tables.
- Two APIs.
- Development and production systems.
- Multiple tenants.
- Imported archives.
If a downstream process removes the source namespace, collisions become inevitable even if they have not happened yet.
NewsDesk had an especially useful identifier already available: the article’s canonical link. The promotion stage resolves source records by link rather than assuming that equal numeric IDs describe equal articles.
The relationship also retains the source table, making the record’s origin explicit.
Why Not Add A Larger Number?
Replacing an integer with a UUID can solve some collision classes, but it does not repair ambiguous historical references by itself. The real requirement is a stable identity contract across stages.
For web articles, a normalized canonical link is meaningful across the pipeline. It supports deduplication and can be checked against both source collections. A composite identity such as source plus source-local ID can also be valid when URLs are absent or mutable.
The correct key depends on the domain. The incorrect key is whichever value happens to be convenient in the current function but loses meaning at the next boundary.
Make Provenance Boring
Data lineage should not require reconstructing application history from logs.
Every promoted NewsDesk article needs enough information to answer:
- Which source collection produced it?
- Which external article did it represent?
- How can that identity be resolved again?
Once those questions are ordinary fields rather than tribal knowledge, reconciliation becomes safer. It also becomes possible to repair derived tables from authoritative source data.
The failure was prevented by recognizing that 42 is not an identity. It is a position inside one namespace. Crossing the boundary required carrying the namespace, or using an identifier that already crossed it.