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.
| Property | Question to ask | Typical risk |
|---|---|---|
| Uniqueness | Can two real instances ever share the value | Reused or recycled codes |
| Irreducibility | Is every attribute in the key necessary | Redundant columns in composite keys |
| Completeness | Does every instance have a value at creation | NULL values for new or foreign records |
| Stability | Will the value ever change | Renamed products, changed emails |
| Authority | Who issues and governs the value | Format changes by an external body |
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.
| Domain | Candidate natural key | Reliability note |
|---|---|---|
| Publishing | ISBN | Different editions receive different numbers |
| Aviation | IATA airport code | Stable but limited to listed airports |
| Finance | ISIN or IBAN | Governed by ISO standards |
| Geography | ISO 3166 country code | Codes can be withdrawn and reassigned |
| User accounts | Email address | Users change addresses over time |
| Personnel | National identification number | Privacy rules and foreign workers without one |
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.
| Aspect | Natural key | Surrogate key |
|---|---|---|
| Business meaning | Readable and meaningful | None |
| Duplicate prevention | Built into the primary key | Needs a separate unique constraint |
| Change handling | Updates cascade to all foreign keys | Unaffected by business changes |
| Index width | Often wide or composite | Usually 4 to 16 bytes |
| Join performance | Slower with long strings | Fast on compact integers |
| Cross-system integration | Shared identifier across systems | Meaningful only inside one database |
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.
| Situation | Recommendation | Reason |
|---|---|---|
| Small code lists | Natural key as primary key | Short, stable and readable |
| Junction table | Composite of both foreign keys | The pair is the natural identity |
| Customer or user entity | Surrogate primary key plus unique natural key | Contact data changes |
| Data warehouse dimension | Surrogate key plus business key column | Supports history tracking |
| Data integration hub | Business key as the anchor | Links records across sources |
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.