Data Demythed

Debunking the "conventional wisdom" of data modelling, normalization, etc.

PK (Primary Key)

Candidate Key(s) become the basis for selecting a Primary Key (PK), which in turn will the basis for Foreign Keys. However, a Primary Key requires more than just the uniqueness of a Candidate Key. A Primary Key also requires invariance to avoid update anomalies. Typically business data is subject to data entry errors and, therefore, Candidate Key(s) based on business data fail this test.

Hence we generally introduce a “system surrogate” Candidate Key, where we can guarantee invariance by having the system assign the value at the time of instance creation. This is not a “system contrivance.” It is part of the business data model (i.e., an outcome of the Normalisation process), necessary for keeping the business data properly organised and connected.