# Surrogate Key

> A made-up ID the warehouse gives each row. It means nothing on its own.

**Field:** Data Engineering  
**Category:** Storage & Warehousing  
**Also known as:** Warehouse Key, Synthetic Key

## Think of it like

It is like a ticket number at a deli counter. It means nothing about you. It just marks your place.

## Definition

A surrogate key is an ID the warehouse makes up for each dimension row. It is usually just a counting number with no meaning. The ID from the source app is kept too, as a normal column. Surrogate keys let one customer have many rows, one per version. They also keep the warehouse safe if a source app reuses or changes its IDs.

## Example

Lucy is customer 881 in the shop app. In the warehouse she has keys 10452 and 20917, one for each city she lived in.

## Why it matters

Type 2 history is not possible without it. Two rows for one customer need two different keys.

## Common mistake

Using the app's customer ID as the warehouse key. It breaks the day the app reuses an ID or a second app joins.

## Three principles

- **Made up.** The warehouse creates it.
- **No meaning.** Just a number that is unique.
- **One per version.** Each row of history gets its own.

## Related terms

- [Dimension Table](https://learn.benibix.com/term/data/dimension-table)
- [Slowly Changing Dimension (SCD)](https://learn.benibix.com/term/data/slowly-changing-dimension)
- [Primary Key](https://learn.benibix.com/term/development/primary-key)
- [Fact Table](https://learn.benibix.com/term/data/fact-table)
- [Natural Key](https://learn.benibix.com/term/data/natural-key)

## Told apart from

- [Natural Key vs Surrogate Key](https://learn.benibix.com/compare/natural-key-vs-surrogate-key): People think a natural key and a surrogate key are two names for one ID, and they are not. A natural key comes from the source, like an email or a product code. People can read it. A surrogate key is a plain number the warehouse makes up. Warehouses join on the surrogate key. They keep the natural key to trace each row back.

---

Source: https://learn.benibix.com/term/data/surrogate-key
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
