offdataai
Retail & E-commerce · data model template

E-commerce EDW data model

Data Vault 2.0 raw vault for e-commerce: hubs (customer/product/order/payment/shipment), links (customer-order, a transactional order-line link with quantity and price, order-payment, order-shipment), and satellites (customer PII, product, an order-state effectivity satellite, payment details with a full-masked card token, and shipment status). Hash keys and load metadata are generated by the DDL layer.

E-commerce enterprise data warehouse modeled as a Data Vault 2.0 raw vault: customer, product, order, payment, and shipment hubs; relationship links plus a transactional order-line link; and descriptive plus effectivity satellites — built for integrating storefront, payment-gateway, and fulfillment source systems with full historization and the combined consumer-privacy and card-data lineage (GDPR, PCI-DSS) that makes Data Vault attractive for commerce platforms. It is a Data Vault 2.0 raw vault: hubs for business keys, links for relationships and satellites for descriptive history, with hash keys and hash diffs generated in the DDL.

Data Vault 2.0Retail & E-commerceGDPRPCI-DSSCCPA
15
tables
94
columns
13
relationships
8
PII columns

Opening the template creates a project with the ERD, platform-native DDL, a dbt project and documentation already generated (recommended platform: BigQuery). Edit it in plain English or on the canvas, then ship it to any supported warehouse.

Subject areas

hubslinkssatellitesreference

Design decisions

  • Hubs hold only commerce business keys

    Separating customer_id, sku, and order_number into hubs lets the storefront, OMS, payment gateway, and WMS attach independently without reworking existing structures — the core agility of Data Vault.

  • Transactional order-line link

    Order line items are immutable purchase events, so the line link is insert-only and carries its measures (quantity, unit_price, line_total) directly — no satellite needed.

  • Effectivity satellite for order state

    An order moves through created → paid → shipped → delivered (or cancelled/refunded); an effectivity satellite records the valid period of each state for accurate as-of fulfillment reporting.

  • PCI-DSS full-masked card token, GDPR-hashed email

    The payment satellite full-masks the card token and the customer satellite hashes email so the governance report flags cardholder and consumer data; load_date + record_source provide the audit lineage both PCI-DSS and GDPR require.

Tables in the E-commerce EDW model

Every table with its grain, columns, types and keys. PK marks a primary key, BK a business key and PII a column classified as personal data, which gets a masking strategy by default.

Hubs (5)

hub_customer

Grain: one row per unique hub_customer business key

ColumnTypeKeys
customer_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_product

Grain: one row per unique hub_product business key

ColumnTypeKeys
skuvarcharBK
load_datetimestamp
record_sourcevarchar

hub_order

Grain: one row per unique hub_order business key

ColumnTypeKeys
order_numbervarcharBK
load_datetimestamp
record_sourcevarchar

hub_payment

Grain: one row per unique hub_payment business key

ColumnTypeKeys
payment_idvarcharBK
load_datetimestamp
record_sourcevarchar

hub_shipment

Grain: one row per unique hub_shipment business key

ColumnTypeKeys
shipment_idvarcharBK
load_datetimestamp
record_sourcevarchar

Links (4)

lnk_customer_order

Grain: one row per lnk_customer_order relationship

Which customer placed which order.

ColumnTypeKeys
customer_hkbinary
order_hkbinary
load_datetimestamp
record_sourcevarchar

lnk_order_line

Grain: one row per order line item (non-historized link)

Transactional (non-historized) link — order line items with qty and price.

ColumnTypeKeys
order_hkbinary
product_hkbinary
line_idvarcharBK
quantityinteger
unit_pricedecimal
line_discountdecimal
line_totaldecimal
currencyvarchar
load_datetimestamp
record_sourcevarchar

lnk_order_payment

Grain: one row per lnk_order_payment relationship

Which payment settled which order.

ColumnTypeKeys
order_hkbinary
payment_hkbinary
load_datetimestamp
record_sourcevarchar

lnk_order_shipment

Grain: one row per lnk_order_shipment relationship

Which shipment fulfilled which order.

ColumnTypeKeys
order_hkbinary
shipment_hkbinary
load_datetimestamp
record_sourcevarchar

Satellites (5)

sat_customer_details

Grain: one row per customer_hk per change

Customer descriptive history (PII).

ColumnTypeKeys
customer_hkbinaryPK
load_datetimestampPK
first_namevarcharPII
last_namevarcharPII
emailvarcharPII
phonevarcharPII
shipping_addressvarcharPII
date_of_birthdatePII
loyalty_tiervarchar
marketing_consentboolean
load_end_datetimestamp
record_sourcevarchar

sat_product_details

Grain: one row per product_hk per change

Product descriptive history.

ColumnTypeKeys
product_hkbinaryPK
load_datetimestampPK
product_namevarchar
categoryvarchar
brandvarchar
list_pricedecimal
currencyvarchar
weight_gramsinteger
is_activeboolean
load_end_datetimestamp
record_sourcevarchar

sat_order_status

Grain: one row per order per status change

Effectivity satellite tracking order state transitions over time.

ColumnTypeKeys
order_hkbinaryPK
load_datetimestampPK
order_statevarchar
channelvarchar
effective_fromtimestamp
effective_totimestamp
is_activeboolean
load_end_datetimestamp
record_sourcevarchar

sat_payment_details

Grain: one row per payment_hk per change

Payment descriptive history — card token full-masked for PCI-DSS.

ColumnTypeKeys
payment_hkbinaryPK
load_datetimestampPK
payment_methodvarchar
card_tokenvarcharPII
card_brandvarchar
last_fourvarcharPII
amountdecimal
currencyvarchar
authorization_codevarchar
payment_statusvarchar
load_end_datetimestamp
record_sourcevarchar

sat_shipment_status

Grain: one row per shipment per status change

Shipment status descriptive history.

ColumnTypeKeys
shipment_hkbinaryPK
load_datetimestampPK
carriervarchar
tracking_numbervarchar
shipment_statevarchar
shipped_datetimestamp
delivered_datetimestamp
destination_countryvarchar
load_end_datetimestamp
record_sourcevarchar

Lookup tables (1)

ref_currency

Grain: one row per ISO currency

ColumnTypeKeys
currency_codevarcharBK
currency_namevarchar
minor_unitssmallint

Relationships

Each relationship is a foreign key on the first table referencing the second.

  • lnk_customer_order.customer_hk → hub_customer (many-to-one)
  • lnk_customer_order.order_hk → hub_order (many-to-one)
  • lnk_order_line.order_hk → hub_order (many-to-one)
  • lnk_order_line.product_hk → hub_product (many-to-one)
  • lnk_order_payment.order_hk → hub_order (many-to-one)
  • lnk_order_payment.payment_hk → hub_payment (many-to-one)
  • lnk_order_shipment.order_hk → hub_order (many-to-one)
  • lnk_order_shipment.shipment_hk → hub_shipment (many-to-one)
  • sat_customer_details.customer_hk → hub_customer (many-to-one)
  • sat_product_details.product_hk → hub_product (many-to-one)
  • sat_order_status.order_hk → hub_order (many-to-one)
  • sat_payment_details.payment_hk → hub_payment (many-to-one)
  • sat_shipment_status.shipment_hk → hub_shipment (many-to-one)

Related templates

All templates →
Start for $1

From requirements to AI-ready context, in one platform.

Describe your business in a conversation, start from a template or connect your own database. Your first model is ready in minutes.

Get startedBook a demo

Plans from $1/month · cancel any time