database-designdata-vault

In data vault 2.0 can we connect a link and a hub through another link?


In data vault 2.0 can we connect a LINK and a HUB through another LINK? and can we connect 2 links too or there should be always 2 hubs through a link and that's it?

I have an observation LINK, connecting related fields HUB holding info being collected, into observation HUB where it contains the value of those fields: (forgot about field naming, just focus on connections)

enter image description here


Solution

  • No, don't do this. If you read the book, it has a section on link-to-link structure. It's only four paragraphs. The first paragraph tells you what it is, and the remaining tells you why you must not do it, it won't scale, will hurt performance , will cost you more in maintenance, ... And to stick with the definition of links, a link is a relation between 2 or more business entities (hub), and not between a business entity and a relation.

    What you should do is to normalize the links to get all business entity hashes you need to define the relationship in one table (link). That way, you won't have to perform unnecessary join in your queries and you won't have to redesign your database if a link change in the future (ie: Link_Observation change it's granularity or it is not used anymore and can be removed)

    And this is also respect the Unit-of-Work