← Back to Pipeline
3
Raw Vault

Links

Links record relationships between business entities. Every time two hubs connect — a customer places an order, a product appears on an order line, a payment settles an invoice — that relationship is stored in a link.

What a Link Contains

  • Link hash key (PK) — MD5 of the combined business keys
  • Hub hash keys (FKs) — references to each participating hub
  • Load datetime — when the relationship was first seen
  • Record source — which source reported it

Link Models in This Pipeline

link_order_customer       — which customer placed which order
link_order_line_order     — which order contains this line item
link_order_line_product   — which product is on this line item
link_order_warehouse      — which warehouse fulfills this order
link_order_contract       — which contract covers this order
link_invoice_order        — which order this invoice belongs to
link_invoice_customer     — which customer receives this invoice
link_invoice_contract     — which contract this invoice is under
link_payment_invoice      — which invoice this payment settles
link_payment_customer     — which customer made this payment
link_payment_contract     — which contract this payment covers
link_contract_customer    — which customer holds this contract
link_contract_manager     — which manager owns this contract

Why 13 Links?

In FMCG, a single order touches many entities: customer, warehouse, contract, manager. Each link captures one specific relationship. This looks like more tables than a star schema — but each link is independently loadable. If a new source adds a new relationship, you add one link. Nothing else changes.

Loading Pattern

Same as hubs — incremental, insert-only. The automate_dv link macro handles deduplication automatically.