What Is a Link in Data Vault?

A link records that business keys belong together: this order belongs to this customer. Datavault Builder covers the classic Data Vault link, and adds a transaction link anchored on a grain hub, which fixes the grain of a transaction and lets transactions relate to each other.

What Is a Link in Data Vault?

The data warehouse automation solution trusted by data teams across industries

Does this sound familiar?

  • One order line appears twice in the link after the source changed its customer, and nobody can tell which row is current.
  • An invoice has to reference the order it bills, and the model has no clean way to connect the two.
  • A link with seven hub keys that only its author can still read.

Hubs tell you which customers, products and orders exist. They say nothing about how those things belong together. That is the job of the link.

In classical modeling terms: a relationship becomes a link. Put simply, a foreign key in a third normal form model is the basis for a link. Where the Order table carries a customer_id, the Data Vault has a link between the order hub and the customer hub.

A link records a relationship between business keys: this order belongs to this customer, this contract covers this product. Like a hub, it stores no descriptive data.

A link table carries:

  • Link hash key. The primary key, a hash over the business keys of every hub it connects.
  • Hub hash keys. One column per participating hub.
  • Load date. When the relationship was first seen.
  • Record source. Which system delivered it.

Links are insert-only, like hubs. A relationship that is seen once stays in the link; whether it is still valid today is a question for an effectivity satellite, which is a later article in this series.

Textbook Data Vault models every link as many-to-many, so it never has to be rebuilt when a one-to-many turns into a many-to-many after a merger or a new system. The structure being many-to-many does not mean the data is, though. If an order is moved to a different customer, it does not now belong to two customers: the new customer replaces the old one. To read a link correctly, you have to know its driving side.

In Datavault Builder the classic link is a binary link between two hubs, and it carries its cardinality: one-to-one, many-to-one, one-to-many or many-to-many. The cardinality says which side drives the relationship, so a change on the driving side is read as a replacement, not as an additional relationship.

Classical model In Data Vault
A foreign key between two entities Binary link between two hubs, with its cardinality
An associative table without attributes Many-to-many link
An associative table with its own attributes Hub with a satellite, plus a transaction link
A transaction such as an order line, with its own key Grain hub, plus a transaction link

For transactions, Datavault Builder adds a second kind of link. A transaction, such as an order line, a payment or a delivery line, relates to several hubs at once, and conventional Data Vault often puts it straight into a link, sometimes a non-historized one with dependent child keys. The grain is then implicit: whatever combination of keys happens to make a row unique. If the source later moves an order line to a different customer, that link holds two rows for the same line, and nothing in the model says which one describes the transaction.

The transaction link makes the grain explicit. The finest grain of the transaction gets its own hub, the grain hub (Hub_Sales_Order_Line, Hub_Payment_Transaction), and the link is anchored on it. That gives the transaction link four properties, each for a reason:

  • A fixed grain. There is one link entry per order line, and the grain cannot drift.

  • A defined driving side. The grain hub drives the relationship. If an order line gets a new product, the new product replaces the old one; the line does not now point to two.

  • Identifying and non-identifying relationships. The grain hub is the identity of the transaction. Customer, product and store participate as references, the same distinction classical ER modeling makes.

    “The key, the whole key, and nothing but the key, so help me Codd.” The classic summary of Codd’s third normal form holds here too: the grain hub is the key of the transaction, and everything else either describes it or refers to another concept.

  • Attributes on a hub. Quantity, price and status go into an ordinary satellite on the grain hub. They can be delta loaded like any other satellite, and more attributes can be added later without remodeling. Data Vault also allows link satellites for this; our experience is that a hub is the better home, and the same applies to an associative table that carries attributes, such as a role or a percentage on a customer-to-contract assignment.

The first rule of Data Vault is that links connect hubs. A link may not reference another link.

Real transactions relate to other transactions all the time: an invoice line matches a delivery line, a payment settles an invoice, a return references an order line. The conventional workaround is to flatten everything into one composite link with six or more hub keys, which is hard to read and turns every load into a large unit of work.

With transaction links the problem disappears. Every transaction already has a grain hub, so a relationship between two transactions is an ordinary link between two hubs:

Hub_Delivery_Line ↔ Link_Delivery_To_Invoice ↔ Hub_Invoice_Line

No link-to-link reference, no dependent child workaround, and every link stays small enough to read.

The pattern goes back to 2017, when I first described it in On Links, including how it compares with the Data Vault 2.0 standard.

What changes with Datavault Builder

  • Both kinds of link, in one model. Binary links for relationships between master data, transaction links where the relationship is a transaction.
  • Cardinality and grain are model decisions. You state the cardinality of a binary link, or what one transaction is, and the tool builds the link and its loads from that.
  • The code is generated. Hash keys, unit of work and insert-only loading follow the same pattern for every link, on Snowflake, Databricks, BigQuery, SQL Server, Fabric, Oracle or PostgreSQL.

What to decide

Take your three most important transactions and write down, for each, what one occurrence is. If the answer is a combination of customer, product and date rather than a line or document number, the grain is implicit, and that is where a transaction link will make the model stable.

See It Running on One of Your Sources

Book a free demo and bring the connector that costs you the most, in money or in time.

Three Steps to a Link

  1. Start from the relationship

    Every foreign key and every associative table in your source model is a candidate link between two hubs.

  2. Set the cardinality

    One-to-one, many-to-one, one-to-many or many-to-many. The cardinality tells which side drives the relationship.

  3. Use a transaction link for transactions

    Order lines, payments and deliveries get a grain hub and a transaction link. Datavault Builder generates the loads.

How Datavault Builder Takes the Friction Out of Ingestion

  • Ingestion is built in

    Batch, delta and CDC loads from databases, files, REST APIs, NoSQL and Python sources, with streams such as Kafka arriving as micro-batches. Same platform that generates the warehouse, no second invoice.

  • Your schema, not the vendor's

    Source tables are mapped to a Data Vault 2.0 model you designed. A new column or a renamed table changes a mapping, not a chain of post-load scripts.

  • Only deltas move

    Hubs, links and satellites load what changed. Full reloads stay in staging instead of being reprocessed downstream every night.

  • History is kept by design

    Every change is retained as it arrives, so as-was reporting works even where the source overwrites its own rows.

  • Code you never hand-write

    Loading, historization and lineage are generated from the model in real time and run natively on Snowflake, Databricks, BigQuery, SQL Server, Fabric, Oracle or PostgreSQL.

  • One platform, up to nine tools fewer

    Modeling, ETL, CI/CD, documentation and lineage in one place. That is what makes 14.7 minutes from requirement to production possible.

Recognized by BARC in The Data Fabric Survey 26

Meet Our Expert

Twenty minutes with our Sales Director, and an honest answer on whether this fits your stack.

Matt Collett

Matt Collett

Sales Director

What are you looking for?

By submitting you agree to our Privacy Policy.

Other Problems This Series Covers

  • Technical vs. Business Keys

    Technical Keys vs. Business Keys in Data Vault

    Source systems keep the business key in the master record, but every relationship runs on technical keys. Four ways to deal with that, what each one costs, and the pattern we use: a PSA hub for the technical keys, mapped to the business key hub.

  • Business Key

    What Is a Business Key in Data Vault?

    A business key is the identifier your employees and customers actually use: the customer number, the invoice number, the contract ID. It is stable, it is shared across systems, and it is what every hub in a Data Vault is built on.

  • Satellite

    What Is a Satellite in Data Vault?

    A satellite holds everything that describes a hub: names, statuses, amounts, and every change to them, appended and never updated. It is a slowly changing dimension type 2 without the UPDATE, with a full audit trail built in.

  • Hub

    What Is a Hub in Data Vault?

    A hub represents one core business concept, such as customer, product or account, as the list of its keys: every one the warehouse has ever seen, each exactly once. It stores identity, not state, and that restraint makes it the point where source system silos collapse.

Questions and Answers