-1

I have the following dimensions:

enter image description here

And I created the following relationship between these two links in my data vault scheme. enter image description here

Is it correct? Is it allowed to connect links directly without hubs? If no how can I do it? Can shipname or shipaddrees be business key?

phpdev
  • 511
  • 4
  • 22
  • Would it be right to assume that one order can consist of multiple products? This would mean that OrderID would not be unique within LINK_Order_Details and so can't be a primary key. – BarneyL Feb 04 '20 at 17:16
  • Additionally what version of the Data Vault standards are you working towards version 1 or 2. If 2 are you using hashes or business keys for your vault keys? – BarneyL Feb 04 '20 at 17:24

1 Answers1

1

Joining a link to another link is not a valid approach in the data vault standards.

Before we start there are a few issues with your current model that suggest misunderstandings of a data vault.

  • OrderID can't be the primary key on the link tables, if there was ever an edit to an order you'd have duplicate primary keys.
  • You ask if ShipName or ShipAddress be can be a business key which suggests you don't fully understand the data vault concept of a business key. A business key implies a new hub to hold that key. It's not impossible that they are but what happens when you have two customers with the same name or one customer changes address. I'd expect it would more likely to see a customer id and then name and address attached to a customer hub.

I think you have two options here:

Firstly assuming that you have an Order hub then leave both link tables connected to it and the connection between order and order details remains implicit\indirect within the data vault. You'll need a satellite attached to the order details link to hold unit price and so on. This is a relatively simple approach but can have pitfalls. For example if one order can have the same product on it more than once there's a risk of losing information or at best you have to handle multi active satellites and driving key relationships.

The second option is to take the stance that Order Details is a business concept in itself and therefore should have its own hub (Order line item or similar concept). Now the new hub links to the order with a one to many relationship and separately links to the products hub. The logic is now simpler but you have to build more objects.

BarneyL
  • 1,332
  • 8
  • 15