SaaS Retention Warehouse
A full analytics warehouse for SaaS revenue and retention. Built a star schema in DuckDB, modeled cohort retention, MRR waterfall, NRR, and LTV, and served metrics through a FastAPI + React dashboard.
- DuckDB
- dbt
- FastAPI
- React
- Cohort Analysis
Role
Data modeling, dbt transformations, API and dashboard build
Timeframe
2025
The problem
Subscription businesses track revenue in billing tools that can't answer retention questions: which cohorts stick, where MRR leaks, and what a customer is actually worth over time.
Approach
- 01
Designed a dimensional star schema (customers, subscriptions, invoices, date) in DuckDB so every metric traces back to a single grain.
- 02
Built version-controlled dbt models for staging, intermediate, and mart layers with tests on keys and revenue totals.
- 03
Modeled cohort retention curves, an MRR waterfall (new, expansion, contraction, churn), net revenue retention, and LTV.
- 04
Exposed the marts through a FastAPI service consumed by a React dashboard with cohort, segment, and period filters.
Outcome
One reconciled source of truth for MRR, NRR, and LTV across the whole subscription lifecycle.
Cohort retention curves that isolate which acquisition months and plans drive long-term revenue.
Reproducible, tested transformations — a metric change is a pull request, not a spreadsheet edit.
More case studies
Readmit-IQ
End-to-end ML system for hospital readmission risk. PySpark medallion architecture, scikit-learn modeling with SHAP explainability, FastAPI inference, and a React frontend with RAG over PubMed via Qdrant.
Surgical Complications Benchmarking
Multi-page Streamlit dashboard benchmarking real CMS hospital surgical outcomes. Includes a calibrated synthetic patient-level layer for risk adjustment and predictive modeling.
Infection Control Surveillance
Streamlit dashboard surveilling real CDC/CMS hospital-acquired infection data. Features funnel-plot control charts, FDR-corrected hypothesis testing, and a predictive model.