dyvenia / dyvenia/dim-modelling-docs

Document `Key Strategy` (surrogate keys: hash hybrid)

Open
#16 0 comments 0 reactions 1 assignee Claimed by @ikarczewska View on GitHub
Dominant language
Python
Stars
0
Forks
0
Avg merge
5d 23h
Merged PRs (30d)
3

Description

## Scope - the page should cover
- Key ownership: the dimension owns and generates the surrogate key; the fact only resolves and retrieves it.
- Hash hybrid: the dimension hashes the natural key to generate the SK; the fact never independently re-generates or hashes the key.
- Unknown member: when the fact cannot resolve a dimension key, the Unknown member's SK is retrieved from the dimension rather than generated in the fact.
- SCD Type 2: the fact resolves the version-correct dimension row using the natural key and event date, then takes the SK from that row.
- Worked examples: standard key assignment, Unknown fallback, and SCD Type 2 point-in-time resolution.
- Anti-pattern: why surrogate keys should not be re-derived or hardcoded in the fact.

_Overview
The Dimension Owns the Key
Example: Key Assignment in Practice
Example: SCD Type 2 Key Assignment
Don't Resolve Keys in the Fact
Key Takeaways
Related_

Related PR: #21

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.