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.
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.
The classic link
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.
If you know classical data modeling, you already know the link
| 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 |
The 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.
Solving the link-to-link problem
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
-
Start from the relationship
Every foreign key and every associative table in your source model is a candidate link between two hubs.
-
Set the cardinality
One-to-one, many-to-one, one-to-many or many-to-many. The cardinality tells which side drives the relationship.
-
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.
Meet Our Expert
Twenty minutes with our Sales Director, and an honest answer on whether this fits your stack.
Matt Collett
Sales Director
Great, pick a time that works for you:
Other Problems This Series Covers
-
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.
-
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.
-
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.
-
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
- Dan Linstedt. He developed the method in the 1990s and published it around 2000. Data Vault 2.0, which adds hash keys, a methodology and an architecture around the model, followed in 2013.
- The standard reference is Building a Scalable Data Warehouse with Data Vault 2.0 by Dan Linstedt and Michael Olschimke (Morgan Kaufmann, 2015).
- No. Bill Inmon sees Data Vault as an evolution of his third normal form view of the enterprise data warehouse, not as a competing approach.
- No. A dimensional output is often part of a Data Vault implementation: the vault keeps the integrated history, and star schemas are built on top of it for reporting. The same vault can also deliver flat tables or a Unified Star Schema.
- With automation, a third normal form view on top of a Data Vault can be generated completely deterministically. The vault holds the data once, and the 3NF layer is derived from the model. How that works.
- Trying it without automation. Data Vault is built on a small set of strict, repeating patterns, which is exactly what makes it tedious and error prone to write by hand and straightforward to generate. That is why you should use Datavault Builder.
- Yes. Splitting keys, relationships and history into hubs, links and satellites means more tables than a normalized or dimensional model. That is why the physical layer should be abstracted by a model-driven approach like Datavault Builder, where you work on the business model and the tables are generated.
- Book a demo and see a Data Vault built on your own sources, or order a training environment and try it yourself.
- Here. Datavault Builder is a Data Vault automation solution: see pricing or book a demo.
- Datavault Builder is licensed annually, as a subscription to use the software. Perpetual licenses are available on request. The editions and what they include are on the pricing page.