3 ms·
I'm strongly against these, I've always regretted it. SKUS, emails, etc all seemed liked good keys. They're always unique right? Until one day when they decid
by thewataccount 4y ago
I'm strongly against these, I've always regretted it.
SKUS, emails, etc all seemed liked good keys. They're always unique right?
Until one day when they decided to rename some skus, they suddenly want family accounts, you realize you really do want the ability to have duplicates so you can keep historical copies without ripping up your entire database.
Semantics change. A UUID/whatever does not.
I've learned you should never ever use a natural key. PKs are extremely difficult or near impossible to replace depending on your application, and if that really means using serial id's, or UUIDs, or extra lookups - it's worth doing that instead of using natural keys.