Advanced Dimension Design Techniques
These techniques incorporate elements from fact tables to create analytically rich dimensions, particularly useful in large-scale environments.
Periodic snapshot fact tables with dimensional attributes
Periodic snapshot fact tables capture the state of the system at regular intervals, combining fact measures with dimensional attributes for trend analysis.
Characteristics:
- Captures system state at regular intervals.
- Incorporates both fact measures and dimensional attributes.
- Allows for trend analysis from a single table.
- Reduces need for complex joins.
User activity periodic snapshot fact table
Slowly changing dimensions with embedded facts
Enhancing SCDs with embedded facts can improve query efficiency by including frequently accessed measures within dimension tables.
Characteristics:
- Implements SCD techniques (typically Type 2) for tracking attribute changes.
- Includes selected fact measures within the dimension table.
- Enables efficient querying of both current and historical states.
Enhanced user dimension with embedded facts
Cumulative user dimensions
Cumulative dimension design aggregates historical data into arrays or JSON structures, allowing efficient querying of long time periods.
Daily snapshot table
Cumulative table
Reduced fact table
A typical cumulative user dimension might look like this: