Data modeling guide
From source data to a shared business model
A customer count depends on more than a join between two tables. Teams need to agree which records identify the same customer, what “active” means and which date the calculation uses. This guide follows one CRM–ERP example from source analysis to the Business Vault.
Start with the business question
Sales wants a list of active customers and their latest orders. The CRM stores customers in kunden and orders in bestellungen. Finance uses an ERP account in cari_hesaplar for the same organisation. Each system identifies the organisation for its own operational purpose.
The example uses CRM customer number C-1042, ERP account code 1042 and order O-208. The team first needs to confirm that both accounts belong to the same customer. It then needs an activity definition. An open account, permission to order and recent purchasing activity are different conditions.
For this example both systems must mark the customer as enabled and an order must fall within a defined period. The evaluation date is fixed at 20 December 2026 and the order date at 5 November 2026. The resulting 45-day interval makes the effect of changing the rule visible.
Why use Data Vault for this problem?
Source systems, schemas and reporting requirements change at different rates. A CRM may introduce a status code, finance may replace an ERP, or sales may revise its activity window. The model still needs to explain earlier records and their origins.
Data Vault uses separate structures for business keys, relationships and changing attributes. In this example those structures support source history and the derivation of a common customer definition. The practical value comes from tracing different business results back to their inputs.
The decision depends on source diversity, change frequency, history requirements and operational capacity. Extra model objects and loading steps need maintenance and testing. A stable report from one source may be adequately served by a simpler model.
Source documentation — establish meaning before loading
Source documentation records what each table row represents, its column names, data types, nullability and key roles. An order header and an order line have different grains. Joining them without recognising that difference can multiply customer counts or amounts.
In the CRM, kunden_id is the primary key of the customer table and a foreign key on the order table. kundennr is the customer number used in business processes. Documenting all three roles connects the technical relationship to the identity used by the business.
Shared naming retains original names and adds model aliases. Translating kunden and cari_hesaplar does not establish that their records refer to the same entity. Identity matching needs a separately verified mapping.
The requirement is then mapped to target fields and original columns. A shared customer ID needs both source keys. Activity needs the source statuses and order date. The latest order also needs the customer–order relationship. This mapping establishes the lineage behind the report.
| Original name | Shared name · EN | Type | Key |
|---|---|---|---|
bestellung_id | order_id | bigint | PK |
bestellnr | order_no | varchar(32) | BK |
kunden_id | customer_id | bigint | FK |
bestelldatum | ordered_at | date | — |
Customer–order relationship CRM.kunden.kunden_id
Stage — make technical preparation explicit
Stage prepares incoming records for the loading process. The example trims whitespace from a customer number and adds the record source and load timestamp. A production design may also specify date parsing, encoding, key preparation and change detection in its loading contract.
Even a technical conversion needs a source-aware decision. Converting a code to a number can remove meaningful leading zeros. Trimming is safe only after the team confirms that surrounding spaces have no business meaning.
Load time records when data entered the platform. Order date records the business event. A late-arriving record can have very different values for the two. The time attributes required to explain historical results must be designed with the source and reporting requirements.
| Column | Source value | Ready to load |
|---|---|---|
CRM.kunden.kundennr | " C-1042 " | C-1042 |
ERP.cari_hesaplar.hesap_kodu | "1042" | 1042 |
CRM.bestellungen.bestellnr | " O-208 " | O-208 |
Raw Vault — retain keys, relationships and history
Hubs hold business keys, links hold relationships between them, and satellites hold descriptive attributes and their history. The example has customer and order hubs, a customer–order link and satellites for source status and order details.
CRM key C-1042 and ERP code 1042 remain traceable in their source contexts before they are assigned a common identity. Similar-looking numbers are insufficient evidence of equivalence. The enabled and 1 status values are retained with their source context as well.
A changed source attribute adds to the relevant history. Its completeness depends on what the source feed captures. A daily extract cannot reconstruct intermediate changes it never received. Extraction frequency and source change tracking therefore define the available history.
C-1042 · 1042C-1042 ↔ O-208O-208SATELLITE · sat_customer_statusenabled / 1
Business Vault — derive business meaning from source facts
Business questions often require interpretation across several sources. A common customer identity, activity classification or derived value is calculated from the source facts retained in the Raw Vault.
The Business Vault makes the required mappings and rules reusable. Reports that need the same activity definition can consume its result. Fields that require no additional rule can pass directly into an appropriate consumption model.
- Source standardization
CRM:C-1042 + ERP:1042- Business rule
- Enabled status + order in the last 90 days
active_customer = trueSource standardization — common identity and meaning
An explicit crosswalk maps CRM:C-1042 and ERP:1042 to CUSTOMER-1042. A production project needs an owner, supporting evidence and change conditions for this mapping. Validity periods matter when an account can move between customers.
Status codes also need a shared interpretation. In this example enabled and 1 both mean enabled. A blocked or closed status requires its own mapping and agreed treatment.
Business rules — date, threshold and decision
The activity rule requires both sources to mark the customer as enabled and the latest order to be within the selected window on the evaluation date. An order that is 45 days old meets the 90-day rule. The same order falls outside a 30-day window.
Reproducible calculations need the evaluation date, window and rule definition. Reapplying a new rule to an old period and explaining the result originally published for that period are different questions. Supporting both can require rule versions and validity dates.
Missing dates, unmatched customers and conflicting statuses also need defined outcomes. Depending on the requirement, these may become data quality findings, review tasks or an explicit unknown result.
Core model — expose the fields a report needs
The OSXIR example exposes a shared customer ID, latest order and activity result together. Mapping establishes identity, a rule calculates classification and the consumption model presents the fields. These responsibilities can change independently.
This three-part arrangement is the OSXIR design used to explain the example. Physical implementation may use views, derived tables or report-oriented models. Grain, refresh requirements and access permissions are agreed for the project.
The checks that make the model dependable
A plausible example result is only the starting point. Check for missing business keys, repeated loads, orphaned orders and unexpected growth in customer counts after a join. Each check should follow a source or requirement contract.
Test activity at the boundary date, customers with no orders, future-dated records and customers disabled in one source. The business owner should confirm the expected outcomes.
Before production use, agree ownership, loading frequency, failure handling, access and change approval. The workspace on this page explains the architecture with fictional records. Real connections and operating procedures are prepared within the project scope.
Try the interactive model
Inspect source fields and key roles. In the Business Vault, compare the 90-day and 30-day windows and follow the result into the core model. The workspace uses fictional records.
customer_vault / main| Column | Type | Key |
|---|---|---|
kunden_id | bigint | PK |
kundennr | varchar(32) | BK |
status | varchar(16) | — |
| Column | Type | Key |
|---|---|---|
cari_id | bigint | PK |
hesap_kodu | varchar(32) | BK |
aktif | smallint | — |
| Column | Type | Key |
|---|---|---|
bestellung_id | bigint | PK |
bestellnr | varchar(32) | BK |
kunden_id | bigint | FK |
bestelldatum | date | — |
WS / 014