|
|
|
|
|
by ak39
1124 days ago
|
|
Always use surrogate primary keys. Use alternate keys (AK) for your "natural keys". Modify the AK business rules as and when needed. There are several advantages to using meaningless random integers, sequential integers or UUIDs as your table's PK. The most important one is that if the PK participates (or is expected to participate) as a foreign key in other tables, it's crucial to us a design where you never ever have to change the PK! |
|
Over a long career I've come to favor UUID, the cost (space and performance) are well worth the advantages.