sqldatabase-designdata-modelingsurrogate-keynatural-key

Relational database design question - Surrogate-key or Natural-key?


Which one is the best practice and Why?

a) Type Table, Surrogate/Artificial Key

Foreign key is from user.type to type.id: alt text

b) Type Table, Natural Key

Foreign key is from user.type to type.typeName: alt text


Solution

  • I believe that in practice, using a natural key is rarely the best option. I would probably go for the surrogate key approach as in your first example.

    The following are the main disadvantages of the natural key approach: