3 ms·
I’ve just always considered natural keys public keys, and added a surrogate key as private key. From the outside you won’t see it, but internally it saves a lo
by moi2388 2y ago
I’ve just always considered natural keys public keys, and added a surrogate key as private key.
From the outside you won’t see it, but internally it saves a lot of headaches.
Space, speed, migrations, I have just never seen an actual downside to using a surrogate.
And if you are absolutely sure, add some unique constraints. Easier to change when you inevitably have to.
Mainly; I’ve learned that my initial assumptions are never correct.