Skip to content
BENIBIX Learn

Surrogate Key

Data🗄️ Storage & WarehousingDimensional Modeling

Also known as Warehouse Key, Synthetic Key

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

Think of it like

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

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.

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.

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.

Key takeaways

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

Compare