3 ms·
Natural keys have a tendency to change over time in what is considered unique. For example, you have a company, and every employee has a unique employee number
by perlgeek 2y ago
Natural keys have a tendency to change over time in what is considered unique.
For example, you have a company, and every employee has a unique employee number generated by HR... until the company merges with another, that also has unique employee numbers, and suddenly the identifier becomes the tuple (organization, employee number) that becomes unique. If you've used the employee number as a foreign key in other tables, you have to change those too.
This is a somewhat contrived example, but I've had enough real, annoying examples happen to me in my career that I avoid natural keys.
- deleted 2y ago[deleted]
- knallfrosch 2y agoAh, how I remember changing my name. People think it only happens now and only to 0.1% of people who decide to change their gender in a leftist Western society, but somehow they forget that people have been changing family names for centuries. And of course, my work email address also changed. Now THAT is fun.