Architecture & Modeling
Lakehouse Medallion architecture, Delta Lake DDL, SCD bi-temporal joins, and partition pruning.
Curriculum Labs (3)
Delta Lake DDL & Partitioning Strategy
Global DynaDatum Bank's monthly deposit reconciliation requires storing 240,000 month-end balance snapshots across 20,000 retail accounts. A junior engineer previously attempted to store raw text dumps without schema controls, leading to corrupted balance calculations. You must create the authoritative Delta Lake table definition for silver.core_balances. Note on Lakehouse architecture: while partitioning small tables (< 100 GB) is often an antipattern, in monthly financial ledger archives, partitioning by month-end snapshot date (balance_date) enables deterministic partition pruning during audit reconciliations (scanning 1 month out of 12 prunes 91.7% of partition files). Crucially, Databricks primary key constraints on Delta tables are declarative and informational (annotated with RELY); they are not enforced at write time. Therefore, data engineers declare primary keys to guide Catalyst query optimization while implementing separate pipeline uniqueness assertions to guarantee no duplicate (account_id, balance_date) rows exist.
SCD Type 2 Temporal Joins: Fix the £8M Cash ISA Discrepancy
Global DynaDatum Bank's executive board pack dropped £8,000,000.00 in reported savings liabilities on May 31, 2026, triggering an urgent Treasury audit. An investigation revealed that 3,000 Cash ISA accounts were misclassified as 'Investments' instead of 'Savings'. On July 1, 2026, Product Operations released version 2 of silver.product_catalog, updating product codes for a new fiscal quarter. Because the downstream reporting pipeline joined silver.core_balances b through silver.core_accounts a to silver.product_catalog p on product_code alone without temporal bounds, historical snapshots joined against future catalog versions—duplicating rows and misclassifying £8M into Investments. You must correct the join logic using effective date boundaries.
Medallion Standardization View (Bronze to Silver)
Raw customer demographic extracts in bronze.crm_customers arrive from upstream CRM channels with inconsistent formatting: mixed-case email addresses with irregular whitespace, erratic UK postal codes containing stray internal spaces, and customer telephone numbers containing hyphens, parentheses, and leading noise. These formatting inconsistencies corrupt downstream entity resolution and prevent reliable joins.