Natural key

Also known as: business key

On this page 7

A natural key is a key made of one or more attributes that already exist in the business domain and uniquely identify each instance of an entity, such as an ISBN for a book, an IATA code for an airport or an email address for a user account. Also called a business key, it is one of the central choices in data modeling, because it determines how rows are identified, joined and deduplicated.

A natural key stands in contrast to a surrogate key, a system-generated value such as an auto-incrementing integer or a UUID that carries no business meaning. Many designs use both: the surrogate key as the primary key and the natural key as an enforced unique constraint.

What qualifies an attribute as a natural key

An attribute or attribute combination qualifies as a natural key when it is a candidate key that originates outside the database. In relational theory, a candidate key must be unique and irreducible: no two rows share the value, and no attribute can be removed without losing uniqueness.

Uniqueness alone is not enough in practice. A good natural key must also be mandatory for every instance, stable over the lifetime of the entity and controlled by an authority that guarantees its rules. The table below lists these properties and the questions a modeler should ask about each one.

PropertyQuestion to askTypical risk
UniquenessCan two real instances ever share the valueReused or recycled codes
IrreducibilityIs every attribute in the key necessaryRedundant columns in composite keys
CompletenessDoes every instance have a value at creationNULL values for new or foreign records
StabilityWill the value ever changeRenamed products, changed emails
AuthorityWho issues and governs the valueFormat changes by an external body
Properties of a reliable natural key

Composite natural keys are common. An order line, for example, may be identified by the order number plus the line number, and a flight by the airline code, flight number and departure date. Each added column makes the key more precise but also wider in every index and foreign key that references it.

Common examples by domain

Natural keys appear wherever an industry or regulator has already defined standardized identifiers. Their reliability varies widely, and some identifiers that look unique are not.

DomainCandidate natural keyReliability note
PublishingISBNDifferent editions receive different numbers
AviationIATA airport codeStable but limited to listed airports
FinanceISIN or IBANGoverned by ISO standards
GeographyISO 3166 country codeCodes can be withdrawn and reassigned
User accountsEmail addressUsers change addresses over time
PersonnelNational identification numberPrivacy rules and foreign workers without one
Natural key candidates and their reliability

Personal identifiers deserve special caution. They are often subject to data protection law, they may be missing for some people, and copying them into every referencing table multiplies the exposure of sensitive data.

Natural key compared with surrogate key

The choice between a natural key and a surrogate key is a trade-off between meaning and stability. A natural key is self-describing and prevents duplicates by design, while a surrogate key never changes and keeps joins narrow.

AspectNatural keySurrogate key
Business meaningReadable and meaningfulNone
Duplicate preventionBuilt into the primary keyNeeds a separate unique constraint
Change handlingUpdates cascade to all foreign keysUnaffected by business changes
Index widthOften wide or compositeUsually 4 to 16 bytes
Join performanceSlower with long stringsFast on compact integers
Cross-system integrationShared identifier across systemsMeaningful only inside one database
Natural key and surrogate key side by side

In dimensional modeling, the distinction is explicit. A dimension table stores the natural key from the source system as the business key column, while a surrogate key serves as the primary key. This arrangement allows a slowly changing dimension to keep several historical versions of the same business entity, each with its own surrogate value.

When to use a natural key as the primary key

A natural key works well as the primary key when the value is short, immutable and universally present. Reference and lookup tables are the classic case: a currency table keyed by the three-letter ISO 4217 code is clear, compact and rarely changes.

SituationRecommendationReason
Small code listsNatural key as primary keyShort, stable and readable
Junction tableComposite of both foreign keysThe pair is the natural identity
Customer or user entitySurrogate primary key plus unique natural keyContact data changes
Data warehouse dimensionSurrogate key plus business key columnSupports history tracking
Data integration hubBusiness key as the anchorLinks records across sources
Decision guide for natural keys

Whatever the primary key, the natural key should normally be declared with a UNIQUE constraint. Without it, a surrogate-keyed table can accumulate the same real customer or product several times, a failure that normalization alone does not prevent.

Pitfalls of natural keys

The most frequent failure of a natural key is the assumption of permanence that the real world later breaks. Companies merge, product codes are restructured and people change names, and every change must then cascade through all referencing tables.

  • Recycled identifiers, such as reused phone numbers, merge the histories of unrelated entities.
  • Format changes, such as the move from 10-digit to 13-digit ISBNs, require migrations of keys and foreign keys.
  • Case and whitespace variations in strings create apparent duplicates unless values are normalized before storage.
  • Late-arriving values force placeholder keys when a record must exist before its identifier is known.
  • Scope confusion occurs when a key is unique only within one country, tenant or period but is treated as globally unique.

These risks do not make natural keys wrong; they make governance and validation essential. Documenting who issues the value, its format and its uniqueness scope is part of a sound logical data model.

Explained without jargon

Every record in a database needs a way to be told apart from the others. A natural key uses something that already identifies the thing in real life, like the number printed on the back of a book or the three-letter code on an airport luggage tag.

The alternative is to give each record a made-up number that means nothing outside the system. Real-life identifiers are easy to understand but can change, while invented numbers stay fixed. Many databases use both, so each one covers the weakness of the other.

A typical use case

A regional library network merges the catalogs of 12 branch libraries into one central database. Each branch had used its own internal record numbers, so the same title often appeared under several unrelated identifiers. The data team decides to treat the ISBN-13 as the natural key for printed editions.

The new edition table keeps a compact surrogate integer as the primary key, which all loan and copy tables reference, and adds a unique constraint on the ISBN-13 column. During the migration, the constraint rejects about 40,000 duplicate rows, which the team resolves by merging records. Older books without an ISBN receive a flag and a manually assigned local identifier. The result is a catalog in which each edition appears exactly once, while loan history remains linked through the stable surrogate key.