Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

DWH Surrogate Primary Key Management

$
0
0

Hi experts,

This is a theoretical question. I would like to figure out which is the best way to manage the primary keys within the DWH and develop the optimal data model.

The primary keys in the source databases are the combination of several fields. As example:

Primary key as employee_number, but in every site brings the same the same employee_numbers which belongs (obviously) to another person. So Site_number + Employee_number is my unique key for my DWH. I am talking about surrogates keys.

To set a unique primary key for each employee in the DWH are the options:

1. Creating new DWH tables with a new unique PK

2. Creating views from both original DBs with a unique PK

TABLES

Advantages:

- The DB relationships are well structure and clear

- Processes are faster

- Traceable through the different DBs related to find out the path root when it is required to check final values fields.

Disadvantages:

- PK are incremental by every update. After a certain period, PK are extremely big, specially with in DBs with millions of records.

- Dependencies between PK and FK are rigid

- Therefore, the tables cannot be truncated and not even drop them in order to discriminate obsolete data with fresh data.

VIEWs

Advantages:

- They are very flexible to be recreated.

- PKs are manageable always, no matter how long.

Disadvantages:

- To trace the origin of a final field value is impossible, once the dependencies from PK and FK are lost.

- Building ER-diagrams is impossible.

- For further developers, the DWH turns into a black-box and split the source Dbs. Only by understanding the code, is possible to see which tables are involved. That means, almost impossible or takes to much time and effort.

- Processes demand high RAM volume and several processors for optimal performance

Could anybody tell me which is the best alternative?

How can I design the best data model for my DWH?

I look forward for any comment.

Regards,




Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>