This project implements an end-to-end data engineering pipeline using the Medallion Architecture pattern in Databricks with Delta Lake and Azure Data Lake Storage (ADLS).
The pipeline processes raw data through three layers:
- Bronze Layer → Raw ingestion
- Silver Layer → Cleaned and transformed data
- Gold Layer → Business-ready KPIs and star schema
The solution also includes:
- Incremental processing using watermarks
- Delta Lake optimizations
- Secure ADLS authentication using Service Principals
- VACUUM maintenance jobs
- Mount-based storage access
.
├── 01_bronze_ingest.ipynb # Raw ingestion into Bronze Delta tables
├── 02_silver_transform.ipynb # Cleansing and transformation into Silver layer
├── 03_gold_kpi.ipynb # KPI generation and Gold star schema
├── vacuum.ipynb # Delta table cleanup and maintenance
└── README.md ┌─────────────────────┐
│ Source Files │
│ CSV / JSON / Parquet│
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Bronze Layer │
│ Raw Delta Storage │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Silver Layer │
│ Cleaned & Validated │
└──────────┬──────────┘
│
▼
┌─────────────────────┐
│ Gold Layer │
│ KPIs & Star Schema │
└─────────────────────┘
| Technology | Purpose |
|---|---|
| Databricks | Data engineering platform |
| Apache Spark | Distributed data processing |
| Delta Lake | ACID-compliant data lake tables |
| Azure Data Lake Storage (ADLS Gen2) | Cloud storage |
| PySpark | ETL transformations |
| Databricks Secrets | Secure credential management |
| Delta VACUUM | Storage optimization |
01_bronze_ingest.ipynb
Loads raw source data into Bronze Delta tables.
- Spark session initialization
- Databricks widgets for runtime configuration
- Secure authentication using Service Principal
- ADLS mount creation
- Canonical column mapping
- Raw data ingestion into Delta tables
- Connectivity validation
- Raw immutable storage
- Schema standardization
- Incremental ingestion
- Delta format storage
02_silver_transform.ipynb
Transforms Bronze data into clean, validated Silver tables.
- Reads Bronze Delta tables
- Watermark-based incremental processing
- Explicit schema enforcement
- Data cleansing and transformation
- Deduplication
- Data quality handling
- Writes curated Delta tables
- Incremental ETL
- Data quality validation
- Transformation logic
- Standardized schemas
03_gold_kpi.ipynb
Creates business KPIs and star schema tables from Silver data.
- Reads curated Silver data
- Builds dimension tables
- Builds fact tables
- Generates KPI tables
- Creates Gold analytical datasets
- Optimized for BI/reporting
- Date Dimension
- Customer Dimension
- Product Dimension
- Location Dimension
- Sales Fact
- Transaction Fact
- KPI Aggregates
- Dimensional modeling
- Star schema
- Business metrics
- Analytical optimization
vacuum.ipynb
Performs Delta Lake cleanup and storage optimization.
- Weekly scheduled execution
- Delta VACUUM operations
- Removal of obsolete files
- Storage optimization
- Delta table maintenance
- Reduces storage usage
- Improves query performance
- Cleans stale Delta files
The project uses:
- Azure Service Principal authentication
- Databricks Secret Scopes
- OAuth-based ADLS access
Store the following in Databricks Secret Scope:
Scope: adls-scope
Keys:
- client-id
- client-secret
- tenant-id
The notebooks dynamically:
- Check existing mounts
- Create mounts if missing
- Connect to ADLS containers
- Reuse mounts across sessions
Example mount paths:
/mnt/bronze
/mnt/silver
/mnt/goldThe Silver layer implements watermark-based incremental processing.
- Read last processed timestamp
- Filter new Bronze records
- Process only new data
- Update watermark
- Faster processing
- Reduced compute cost
- Scalable ETL execution
| Feature | Usage |
|---|---|
| ACID Transactions | Reliable updates |
| Time Travel | Historical recovery |
| Schema Enforcement | Data consistency |
| VACUUM | Storage cleanup |
| Delta Format | Optimized analytics |
Create Databricks secret scope and store:
- Client ID
- Client Secret
- Tenant ID
Attach all notebooks to a Databricks cluster.
Recommended:
- Runtime: Databricks Runtime 13+
- Spark 3+
| Notebook | Frequency |
|---|---|
| Bronze Ingestion | Daily |
| Silver Transformation | Daily |
| Gold KPI | Daily |
| VACUUM | Weekly |
The project includes:
- Incremental processing
- Delta Lake optimizations
- Partition-aware design
- Efficient storage layout
- VACUUM cleanup
- Z-Ordering
- OPTIMIZE commands
- Unity Catalog integration
This project demonstrates:
- Medallion architecture implementation
- Delta Lake best practices
- Incremental ETL design
- Secure cloud storage access
- Databricks notebook orchestration
- Dimensional modeling
- Production-style data engineering workflows