Modular Databricks pipelines with common, mock, and bronze layers
Project description
๐ Databricks Pipelines โ Modular Unity Architecture (Notebooks + Python)
This repository contains scalable, modular data pipelines built on Azure Databricks, featuring Unity Catalog, Delta Lake, Azure Blob Storage, SQL Server (via JDBC), and Azure Data Factory (ADF).
It supports dual execution modes:
- Notebook-driven orchestration (for exploration and visualization)
- Git-tracked Python scripts (for production-ready, CI/CD-compliant workflows)
๐ก All data is now managed through Unity Catalog, with Delta tables registered in thebetty catalog under Bronze, Silver, and Gold schemas.
Raw source data still flows through Azure Blob containers (e.g., raw-ingest, external-ingest) before being processed into Unity-managed Volumes.
๐ง Whatโs New in This Version?
- โ
Full transition to Unity Catalog:
/Volumes/thebetty/...+thebetty.<schema>.<table> - โ Modular Python-based pipeline executed via Databricks Workflows
- โ Registered Delta tables for BI/SQL access at each layer
- โ SQL Server ingestion via secure JDBC + Ngrok + Key Vault
- โ Structured logging of pipeline runs to Gold
๐ Unity Catalog Overview
| Layer | Path Example | Unity Table Example |
|---|---|---|
| Bronze | /Volumes/thebetty/bronze/inventory |
thebetty.bronze.inventory |
| Silver | /Volumes/thebetty/silver/finance_with_vendor_info |
thebetty.silver.finance_with_vendor_info |
| Gold | /Volumes/thebetty/gold/final_vendor_summary |
thebetty.gold.final_vendor_summary |
| Logs | /Volumes/thebetty/gold/logs/final_vendor_summary_runs |
thebetty.gold.final_vendor_summary_runs |
๐ฆ Project Structure
databricks-pipelines/
โโโ pipeline1_batch_delta/
โ โโโ bronze_py/ # Python-based ingestion scripts (Unity Bronze)
โ โโโ silver_py/ # Python-based transformation and joins (Unity Silver)
โ โโโ gold_py/ # Python-based aggregations and outputs (Unity Gold)
โ โโโ utils_py/ # Reusable utility functions (e.g., upsert, write)
โ โโโ tests/ # Unit tests and mock data validations
โ โโโ docs/ # Optional design notes or diagrams
โโโ common/ # Shared modules across pipelines (planned)
โโโ LICENSE
โโโ README.md
๐ Dual Execution Modes
You can now run this pipeline in two different ways:
โถ๏ธ Option 1: Notebook Workflow
Execute directly in Databricks Repos UI:
bronze/ โ silver/ โ gold/
โถ๏ธ Option 2: Python Job Workflow
Run the batch1_py_pipeline job via Databricks Workflows:
bronze_py/ โ silver_py/ โ gold_py/
Each script uses utilities in utils_py/ for modularity and testing.
๐ Pipeline Variants (Planned)
| Pipeline | Features |
|---|---|
pipeline1_batch_delta |
Batch ingestion (ADF + Blob + SQL) โ Silver normalization โ Gold aggregation |
FUTURE-pipeline2_modular_functions |
Centralized utilities (upsert, SQL, mount) reusable across pipelines |
FUTURE-pipeline3_autoloader_batch |
Ingest batch files via Autoloader (triggered) |
FUTURE-pipeline4_streaming_mode |
Continuous Structured Streaming ingestion |
๐งฐ Technologies
๐น Compute & Processing
- Azure Databricks (Runtime 15.4+)
- PySpark
๐น Ingestion & Integration
- Azure Data Factory (ADF) for vendor registry
- SQL Server via JDBC tunnel + Ngrok
- Azure Blob Storage: Raw file drop zone
๐น Data Management
- Delta Lake (Bronze, Silver, Gold architecture)
- Unity Catalog: Unified governance for all tables
- Databricks Workflows: Visual pipeline orchestration
๐น Security & Source Control
- GitHub with Databricks Repos
- Azure Key Vault + Secret Scope (
databricks-secrets-lv426)
๐ Pipeline Flow
Azure Blob + ADF + SQL Server
โ
โผ
๐ซ Bronze Layer (Ingestion)
- Ingest raw CSV, JSON, and SQL data (JDBC)
- No transformations
โช Silver Layer (Cleansing)
- Normalize, deduplicate, validate
- Join registry + compliance + finance
๐ฅ Gold Layer (Aggregation)
- Join Silver datasets
- Aggregate by vendor_id
- Partitioned by `tier`
- Tracked via pipeline run timestamp
๐ Gold Output
| Column | Description |
|---|---|
vendor_id |
Unique vendor identifier |
vendor_name |
Clean, human-readable name |
total_invoices |
Distinct invoice count |
latest_due_date |
Most recent due date |
latest_invoice_date |
Most recent invoice date |
last_audit_date |
Most recent compliance audit |
compliance_score |
Latest score (0โ100 scale) |
compliance_status |
Compliant, At Risk, etc. |
industry |
Vendor industry from registry |
headquarters |
City from registry |
onwatchlist |
Boolean flag from registry |
registration_date |
Original vendor registration date |
tier |
Vendor tier from ADF |
pipeline_run_timestamp |
Ingestion run timestamp |
๐ SQL Server Integration via Ngrok + Key Vault
- Tunnels from
localhost:1433to public via Ngrok - Uses Azure Key Vault for:
- JDBC URL
- SQL Username / Password
jdbc_url = dbutils.secrets.get(scope="databricks-secrets-lv426", key="sql-jdbc-url")
df = spark.read.jdbc(url=jdbc_url, table="your_table_name", properties=...)
๐ Security Highlights
- ๐ No plaintext credentials
- โ GitHub secrets excluded
- ๐ Secrets managed with Azure Key Vault + Databricks scopes
- โ Volumes replace legacy mounts
๐ชช License
MIT License
Maintained by AstroSpiderBaby
Last updated: July 29, 2025
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file databricks_pipelines-0.2.8.tar.gz.
File metadata
- Download URL: databricks_pipelines-0.2.8.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6956f745f36ee4bc8e2ef03795ca682d860b9cf1710f813bb46a21f54e4e5f95
|
|
| MD5 |
2af6a352af9293e78ae4825ef24896f3
|
|
| BLAKE2b-256 |
c87f5bee64e611912eec25d3b1e4819d6cd4a82e70c3e12647df3741d019cf5e
|
File details
Details for the file databricks_pipelines-0.2.8-py3-none-any.whl.
File metadata
- Download URL: databricks_pipelines-0.2.8-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
230e632b5825ca8bd6fb7e63965cca8b38f63843a90457d3a559784cfe5095c4
|
|
| MD5 |
6b9b47abdbf49aa0a0ba717eed44fe1e
|
|
| BLAKE2b-256 |
c00888b69ed456757b2ac890e0e710575a780dfd7bb80dfcf775a24f380aba37
|