Data vault modeling


Data vault modeling is a database modeling method that is designed to provide long-term historical storage of data coming in from multiple operational systems. It is also a method of looking at historical data that deals with issues such as auditing, tracing of data, loading speed and resilience to change as well as emphasizing the need to trace where all the data in the database came from. This means that every row in a data vault must be accompanied by record source and load date attributes, enabling an auditor to trace values back to the source. It was developed by Daniel Linstedt in 2000.
Data vault modeling makes no distinction between good and bad data. This is summarized in the statement that a data vault stores "a single version of the facts" as opposed to the practice in other data warehouse methods of storing "a single version of the truth" where data that does not conform to the definitions is removed or "cleansed".
The modeling method is designed to be resilient to change in the business environment where the data being stored is coming from, by explicitly separating structural information from descriptive attributes. Data vault is designed to enable parallel loading as much as possible, so that very large implementations can scale out without the need for major redesign.

History and philosophy

In data warehouse modeling there are two well-known competing options for modeling the layer where the data are stored. Either you model according to Ralph Kimball, with conformed dimensions and an enterprise data bus, or you model according to Bill Inmon with the database normalized. Both techniques have issues when dealing with changes in the systems feeding the data warehouse. For conformed dimensions you also have to cleanse data and this is undesirable in a number of cases since this inevitably will lose information. Data vault is designed to avoid or minimize the impact of those issues, by moving them to areas of the data warehouse that are outside the historical storage area and by separating the structural items from the descriptive attributes.
Dan Linstedt, the creator of the method, describes the resulting database as follows:
Data vault's philosophy is that all data is relevant data, even if it is not in line with established definitions and business rules. If data are not conforming to these definitions and rules then that is a problem for the business, not the data warehouse. The determination of data being "wrong" is an interpretation of the data that stems from a particular point of view that may not be valid for everyone, or at every point in time. Therefore the data vault must capture all data and only when reporting or extracting data from the data vault is the data being interpreted.
Another issue to which data vault is a response is that more and more there is a need for complete auditability and traceability of all the data in the data warehouse. Due to Sarbanes-Oxley requirements in the USA and similar measures in Europe this is a relevant topic for many business intelligence implementations, hence the focus of any data vault implementation is complete traceability and auditability of all information.
Data Vault 2.0 is the new specification, it is an open standard. The new specification contains components which define the implementation best practices, the methodology, the architecture, and the model. Data Vault 2.0 has a focus on including new components such as Big Data, NoSQL - and also focuses on performance of the existing model. The old specification is highly focused on data vault modeling. It is documented in the book: Building a Scalable Data Warehouse with Data Vault 2.0.
It is necessary to evolve the specification to include the new components, along with the best practices in order to keep the EDW and BI systems current with the needs and desires of today's businesses.

History

Data vault modeling was originally conceived by Dan Linstedt in the 1990s and was released in 2000 as a public domain modeling method. In a series of five articles on The Data Administration Newsletter the basic rules of the Data Vault method are expanded and explained. These contain a general overview, an overview of the components, a discussion about end dates and joins, link tables, and an article on loading practices.
An alternative name for the method is "Common Foundational Integration Modelling Architecture."
Data Vault 2.0 has arrived on the scene as of 2013 and brings to the table Big Data, NoSQL, unstructured, semi-structured seamless integration, along with methodology, architecture, and implementation best practices.

Alternative interpretations

According to Dan Linstedt, the Data Model is inspired by a simplistic view of neurons, dendrites, and synapses – where neurons are associated with Hubs and Hub Satellites, Links are dendrites, and other Links are synapses. By using a data mining set of algorithms, links can be scored with confidence and strength ratings. They can be created and dropped on the fly in accordance with learning about relationships that currently don't exist. The model can be automatically morphed, adapted, and adjusted as it is used and fed new structures.
Another view is that a data vault model provides an ontology of the Enterprise in the sense that it describes the terms in the domain of the enterprise and the relationships among them, adding descriptive attributes where necessary.
Another way to think of a data vault model is as a graph model. The data vault model actually provides a "graph based" model with hubs and relationships in a relational database world. In this manner, the developer can use SQL to get at graph based relationships with sub-second responses.

Basic notions

Data vault attempts to solve the problem of dealing with change in the environment by separating the business keys and the associations between those business keys, from the descriptive attributes of those keys.
The business keys and their associations are structural attributes, forming the skeleton of the data model. The data vault method has as one of its main axioms that real business keys only change when the business changes and are therefore the most stable elements from which to derive the structure of a historical database. If you use these keys as the backbone of a data warehouse, you can organize the rest of the data around them. This means that choosing the correct keys for the hubs is of prime importance for the stability of your model. The keys are stored in tables with a few constraints on the structure. These key-tables are called hubs.

Hubs

Hubs contain a list of unique business keys with low propensity to change. Hubs also contain a surrogate key for each Hub item and metadata describing the origin of the business key. The descriptive attributes for the information on the Hub are stored in structures called Satellite tables which will be discussed below.
The Hub contains at least the following fields:
A hub is not allowed to contain multiple business keys, except when two systems deliver the same business key but with collisions that have different meanings.
Hubs should normally have at least one satellite.

Hub example

This is an example for a hub-table containing cars, called "Car". The driving key is vehicle identification number.
FieldnameDescriptionMandatory?Comment
H_CAR_IDSequence ID and surrogate key for the hubNoRecommended but optional
VEHICLE_ID_NRThe business key that drives this hub. Can be more than one field for a composite business keyYes-
H_RSRCThe record source of this key when first loadedYes-
LOAD_AUDIT_IDAn ID into a table with audit information, such as load time, duration of load, number of lines, etc.No-

Links

Associations or transactions between business keys are modeled using link tables. These tables are basically many-to-many join tables, with some metadata.
Links can link to other links, to deal with changes in granularity. For instance, if you have an association between customer and address, you could add a reference to a link between the hubs for product and transport company. This could be a link called "Delivery". Referencing a link in another link is considered a bad practice, because it introduces dependencies between links that make parallel loading more difficult. Since a link to another link is the same as a new link with the hubs from the other link, in these cases creating the links without referencing other links is the preferred solution.
Links sometimes link hubs to information that is not by itself enough to construct a hub. This occurs when one of the business keys associated by the link is not a real business key. As an example, take an order form with "order number" as key, and order lines that are keyed with a semi-random number to make them unique. Let's say, "unique number". The latter key is not a real business key, so it is no hub. However, we do need to use it in order to guarantee the correct granularity for the link. In this case, we do not use a hub with surrogate key, but add the business key "unique number" itself to the link. This is done only when there is no possibility of ever using the business key for another link or as key for attributes in a satellite. This construct has been called a 'peg-legged link' by Dan Linstedt on his forum.
Links contain the surrogate keys for the hubs that are linked, their own surrogate key for the link and metadata describing the origin of the association. The descriptive attributes for the information on the association are stored in structures called satellite tables which are discussed below.

Link example

This is an example for a link-table between two hubs for cars and persons. The link is called "Driver".
FieldnameDescriptionMandatory?Comment
L_DRIVER_IDSequence ID and surrogate key for the LinkNoRecommended but optional
H_CAR_IDsurrogate key for the car hub, the first anchor of the linkYes
H_PERSON_IDsurrogate key for the person hub, the second anchor of the linkYes
L_RSRCThe recordsource of this association when first loadedYes
LOAD_AUDIT_IDAn ID into a table with audit information, such as load time, duration of load, number of lines, etc.No

Satellites

The hubs and links form the structure of the model, but have no temporal attributes and hold no descriptive attributes. These are stored in separate tables called satellites. These consist of metadata linking them to their parent hub or link, metadata describing the origin of the association and attributes, as well as a timeline with start and end dates for the attribute. Where the hubs and links provide the structure of the model, the satellites provide the "meat" of the model, the context for the business processes that are captured in hubs and links. These attributes are stored both with regards to the details of the matter as well as the timeline and can range from quite complex to quite simple.
Usually the attributes are grouped in satellites by source system. However, descriptive attributes such as size, cost, speed, amount or color can change at different rates, so you can also split these attributes up in different satellites based on their rate of change.
All the tables contain metadata, minimally describing at least the source system and the date on which this entry became valid, giving a complete historical view of the data as it enters the data warehouse.

Satellite example

This is an example for a satellite on the drivers-link between the hubs for cars and persons, called "Driver insurance". This satellite contains attributes that are specific to the insurance of the relationship between the car and the person driving it, for instance an indicator whether this is the primary driver, the name of the insurance company for this car and person and a summary of the number of accidents involving this combination of vehicle and driver. Also included is a reference to a lookup- or reference table called R_RISK_CATEGORY containing the codes for the risk category in which this relationship is deemed to fall.
FieldnameDescriptionMandatory?Comment
S_DRIVER_INSURANCE_IDSequence ID and surrogate key for the satellite on the linkNoRecommended but optional
L_DRIVER_ID primary key for the driver link, the parent of the satelliteYes-
S_SEQ_NROrdering or sequence number, to enforce uniqueness if there are several valid satellites for one parent keyNoThis can happen if, for instance, you have a hub COURSE and the name of the course is an attribute but in several different languages.
S_LDTSLoad Date for the validity of this combination of attribute values for parent key L_DRIVER_IDYes-
S_LEDTSLoad End Date for the validity of this combination of attribute values for parent key L_DRIVER_IDNo-
IND_PRIMARY_DRIVERIndicator whether the driver is the primary driver for this carNo -
INSURANCE_COMPANYThe name of the insurance company for this vehicle and this driverNo -
NR_OF_ACCIDENTSThe number of accidents by this driver in this vehicleNo -
R_RISK_CATEGORY_CDThe risk category for the driver. This is a reference to R_RISK_CATEGORYNo -
S_RSRCThe recordsource of the information in this satellite when first loadedYes-
LOAD_AUDIT_IDAn ID into a table with audit information, such as load time, duration of load, number of lines, etc.No-

at least one attribute is mandatory.
sequence number becomes mandatory if it is needed to enforce uniqueness for multiple valid satellites on the same hub or link.

Loading practices

The ETL for updating a data vault model is fairly straightforward. First you have to load all the hubs, creating surrogate IDs for any new business keys. Having done that, you can now resolve all business keys to surrogate ID's if you query the hub. The second step is to resolve the links between hubs and create surrogate IDs for any new associations. At the same time, you can also create all satellites that are attached to hubs, since you can resolve the key to a surrogate ID. Once you have created all the new links with their surrogate keys, you can add the satellites to all the links.
Since the hubs are not joined to each other except through links, you can load all the hubs in parallel. Since links are not attached directly to each other, you can load all the links in parallel as well. Since satellites can be attached only to hubs and links, you can also load these in parallel.
The ETL is quite straightforward and lends itself to easy automation or templating. Problems occur only with links relating to other links, because resolving the business keys in the link only leads to another link that has to be resolved as well. Due to the equivalence of this situation with a link to multiple hubs, this difficulty can be avoided by remodeling such cases and this is in fact the recommended practice.
Data is never deleted from the data vault, unless you have a technical error while loading data.

Data vault and dimensional modelling

The data vault modelled layer is normally used to store data. It is not optimized for query performance, nor is it easy to query by the well-known query-tools such as Cognos, OBIEE, SAP Business Objects, Pentaho et al. Since these end-user computing tools expect or prefer their data to be contained in a dimensional model, a conversion is usually necessary.
For this purpose, the hubs and related satellites on those hubs can be considered as dimensions and the links and related satellites on those links can be viewed as fact tables in a dimensional model. This enables you to quickly prototype a dimensional model out of a data vault model using views.
Note that while it is relatively straightforward to move data from a data vault model to a dimensional model, the reverse is not as easy, given the denormalized nature of the dimensional model's fact tables, fundamentally different to the third normal form of the data vault.

Data vault methodology

The data vault methodology is based on SEI/CMMI Level 5 best practices. It includes multiple components of CMMI Level 5, and combines them with best practices from Six Sigma, TQM, and SDLC. Particularly, it is focused on Scott Ambler's agile methodology for build out and deployment. Data vault projects have a short, scope-controlled release cycle and should consist of a production release every 2 to 3 weeks.
Teams using the data vault methodology should readily adapt to the repeatable, consistent, and measurable projects that are expected at CMMI Level 5. Data that flow through the EDW data vault system will begin to follow the TQM life-cycle that has long been missing from BI projects.

Tools

Citations