4 ms·
"Natural keys" just means that someone else can change them under your feet. People change names, their phone numbers, passport numbers. Governments change the
by kijin 2y ago
"Natural keys" just means that someone else can change them under your feet.
People change names, their phone numbers, passport numbers. Governments change their numbering schemes all the time. Corporations merge and split. Heck, even governments merge and split, surprisingly often, at the municipal level. All without your knowledge or consent. And you're left wondering why you suddenly have duplicate key errors in your database.
The only key that you can trust is one that you, and only you, control. That's the point of the surrogate key. Whether it's BIGINT or UUID v7 is beside the point.