How mubashirmian/dwh_iba_ works
This repository implements a pharmaceutical cold-chain data warehouse and Sales & Demand Intelligence mart. Its principal workflow lands source files in Bronze, validates the landing, transforms data through dbt Silver and Gold, and runs dbt tests; Airflow orders those stages. Gold supports sales, hospital-demand, and inventory analysis, while benchmark, verification, and Prometheus/Grafana observability are additional capabilities. The workflow and capabilities are described in the README; unsampled dbt models and service wiring are represented only at subsystem level.
Main entry points: dag_mart_sdi.py Airflow DAG · gold Gold star schema · load_bronze.py Bronze loader · silver Silver transformations
Components 16
Orchestration
- Airflow DAG
dags/dag_mart_sdi.py
Ingestion
- Bronze loader
scripts/load_bronze.py - Bronze tables
sql/ddl/02_bronze_tables.sql - Bronze validation
scripts/check_bronze.py - Batch generator
scripts/generate_synthetic_batch.py
Warehouse Modeling
- Silver transformations
dbt/models/silver - Gold star schema
dbt/models/gold - dbt data tests
dbt/models/schema.yml
Analytics and Observability
- SDI verification
scripts/verify_sdi.py - Gold benchmarks
scripts/run_bench.py - Gold optimization
scripts/optimize_gold.py - Metric publisher
scripts/push_all_metrics.py - Pushgateway
- Prometheus
config/prometheus/prometheus.yml - Grafana dashboards
config/grafana/dashboards
Other components
- Source data
Connections 17
- Source data → Bronze loader: loads
README.md - Airflow DAG → Bronze loader: runs
dags/dag_mart_sdi.py - Bronze loader → Bronze tables: lands data
README.md - Airflow DAG → Bronze validation: runs next
dags/dag_mart_sdi.py - Bronze validation → Bronze tables: validates
scripts/check_bronze.py - Airflow DAG → Silver transformations: runs dbt
dags/dag_mart_sdi.py - Silver transformations → Bronze tables: transforms
README.md - Airflow DAG → Gold star schema: runs dbt
dags/dag_mart_sdi.py - Gold star schema → Silver transformations: models from
README.md - Airflow DAG → dbt data tests: tests after build
dags/dag_mart_sdi.py - Batch generator → Source data: generates batches
- SDI verification → Source data: verifies source
- Gold benchmarks → Gold star schema: queries
scripts/run_bench.py - Gold optimization → Gold star schema: indexes and benchmarks
scripts/optimize_gold.py - Metric publisher → Pushgateway: pushes metrics
scripts/push_all_metrics.py - Prometheus → Pushgateway: scrapes
README.md - Grafana dashboards → Prometheus: visualizes metrics
README.md