Data Vault - 如何 select 业务密钥?

Data Vault - How to select business keys?

如果以下三个唯一属性从 3NF 模型中的 SalesOrderHeader table 到达,那么哪一个将是 SalesOrderHeader Hub 的理想业务键:

  1. SalesOrderID(原来table的PK)
  2. 销售订单号
  3. 采购订单号

定义

根据 Data Vault 2.0 方法,业务密钥是业务用来识别一条记录的密钥(来自 here):

Business keys are supposed to have meaning to the business user. In a perfect world, they really should be decipherable by individuals who live and work in that industry. For instance, VIN (vehicle identification number) numbers are really well known to those who work in the auto industry. Some individuals are so adept at reading these numbers they can tell you what some of the sequences mean – define the number for you. [..]

This key doesn’t change when it goes from the Sales system to the Contracts system, it doesn’t change when it’s transferred from the contracts system to the manufacturing system, or any other system in the business. It stays consistent once assigned. [..]

案例

注意:我在回答中假设了很多,因为我不了解业务及其依赖关系。

SalesOrderID 是一个内部 ID,除了技术用户外,任何人都看不到。

PurchaseOrderNumber 可能连接到 Purchase,这在语义上可能完全不同。尽管根据用例的不同,这个键甚至代理键可能是有意义的。

所以为了识别 SalesOrderHeader 我会使用 SalesOrderNumber 因为这个数字似乎直接与 header.

相关联