33 / 35 · Extensions
Data Vault
Keep the business identities, relationships and source history of a store assortment separate, then reconstruct what the warehouse knew at a given time.
A catalog identifies the 50 g tea pack as TEA-50. A store assortment feed says store S11 carries it. The catalog later changes the display name, while the assortment feed still refers to the same product. An integration layer needs to keep the stable keys and both sets of reported facts.
Separate the key, the association and its description#
A hub records a business key at a defined grain. The product hub has one row for TEA-50. The store hub has one for S11. Each can have a warehouse ID and metadata about when and where the key first arrived. A link records an association. The store-product link in this example has one row per pair of store and product. A satellite attaches descriptive attributes and their history to a hub or link. The catalog name belongs to a product satellite, while assortment status belongs to a satellite on the store-product link. Graziano and Linstedt, 2011, §§4–6
Three kinds of record for the assortment
The grain decides when to reuse a key. The pair in the link identifies assortment membership across time. The same pair would not identify every sale at the store. Modeling individual sales needs a transaction identity or a link grain that distinguishes occurrences. Implementations can use different warehouse identifiers, including hash keys. A hash represents an agreed key. It cannot determine whether equal codes from different sources refer to the same business entity. AutomateDV, Hubs and Links
Reconstruct the known state#
Suppose the product satellite receives two rows. Use distinct load times for this example.
| Parent | Load time in UTC | Source | Name |
|---|---|---|---|
| TEA-50 | 1 November, 09:00 | catalog | Tea 50 g |
| TEA-50 | 5 November, 10:00 | catalog | Black tea 50 g |
To reconstruct what the warehouse knew on 4 November, filter to rows loaded by that time and select the latest of those. It returns “Tea 50 g”. After the second load, the latest value is “Black tea 50 g”. A separate effective date would answer when the catalog intended the new name to apply. A late arrival can carry an effective date before its load time. If sources disagree, keep their evidence separate and make the resolution rule explicit in the layer that serves the result.
Serve the report at its own grain#
The integration model keeps identities, relationships and reported history apart. To present one row per sales line with product and store labels, resolve the relevant versions and join the needed values. The result can be projected into a dimensional mart whose fact rows have the measurement grain used by reports. The mart and the integration layer answer different questions. Kimball, 2008
There is a cost in more tables, load rules and joins. If a source already supplies a well-defined small history, the extra model may buy little. When sources change independently, separate satellites can preserve their histories while keeping the shared keys stable.
Next#
Anchor Modeling separates changing attributes at a finer grain. Compare how it adds a new property and reconstructs the same product.
References#
- Kent Graziano and Dan Linstedt. Introduction to Data Vault Modeling, 2011. §§4–6 define hubs, links, satellites and their loading metadata.
- AutomateDV. Hubs and Links. Describes one implementation of business keys and association grain.
- Ralph Kimball. Fact Tables, 2008. Explains the measurement grain of dimensional fact tables.