Delivered remotely for a business based in Chicago, United States. Names withheld by agreement.
Project Overview
Enterprise analytics ecosystems often age into brittle monoliths: decades of undocumented T-SQL stored procedures, fragile SSIS packages running on oversized single-node servers, and copy-pasted CSV extracts powering critical operational workflows. When nightly batch windows overrun into business hours, executive reporting stalls, upstream ERP schema tweaks trigger silent null-propagation cascades, and product teams resort to scraping production replicas to power customer-facing analytics.
We led the end-to-end modernization of an enterprise data warehouse into a governed cloud lakehouse using Python, dbt, Snowflake, Apache Iceberg, and FastAPI. The resulting Web and API data platform establishes version-controlled SQL engineering practices, isolates compute workloads cleanly, preserves open-format storage portability, and exposes curated, policy-enforced datasets to downstream applications through fast REST endpoints.
Legacy Warehouse Constraints
Auditing the legacy analytics footprint exposed structural bottlenecks across ingestion, transformation, and consumption:
- Single-node compute contention: Heavy end-of-month financial close batch jobs competed directly with morning BI queries on fixed on-premise hardware, creating unpredictable slowdowns.
- Zero test coverage or lineage: Business logic lived buried inside nested stored procedures with no automated unit tests, making even minor metric definition updates risky across dozens of downstream reports.
- Duplicate data silos: Machine learning scripts, finance spreadsheets, and internal web apps each pulled separate extracts from source databases, causing conflicting revenue and inventory numbers across departments.
- Uncontrolled credential sprawl: Applications querying the data warehouse directly held broad read credentials without centralized rate limiting, caching, or semantic metric definitions.
Architectural Strategy
Rather than executing a blind "lift-and-shift" of legacy stored procedures into the cloud, we rebuilt the platform around a medallion lakehouse architecture paired with strict software engineering discipline for SQL. Python extraction pipelines ingest raw operational data into Apache Iceberg tables on cloud object storage (Bronze), eliminating proprietary storage lock-in for heavy raw history and ML feature workloads.
From there, Apache Airflow triggers modular dbt Core transformations inside Snowflake (Silver conformed entities and Gold business marts). Every model lives in Git with pull-request CI checks that spin up zero-copy Snowflake clones to validate schema contracts before merging. Finally, FastAPI microservices sit in front of Gold serving tables so internal and partner web applications consume governed, cached metrics over HTTP rather than embedding raw warehouse SQL.
Core Capabilities
- Modular dbt Medallion Modeling: Standardized staging, intermediate, and mart layers with reusable Jinja macros, incremental merge strategies, and enforced primary-key/referential-integrity tests.
- Dual-Format Iceberg & Snowflake Interoperability: Open Apache Iceberg tables allow Python data science jobs and Snowflake SQL engines to query consistent snapshots without duplicating terabytes of raw history.
- Automated Parity & Quality Gates: Python statistical checks and dbt tests verify freshness SLAs, anomaly bounds, and legacy-to-cloud reconciliation parity during migration cutovers.
- Governed FastAPI Metric & Export APIs: Typed OpenAPI endpoints serve paginated operational datasets, pre-aggregated KPI summaries, and signed async export jobs with role-scoped filtering.
- Lineage & FinOps Observability Portal: A React governance interface visualizes upstream-to-downstream dbt DAG lineage, test failure history, and warehouse credit burn by team and query tag.
Technical Architecture
Python workers extract incremental CDC streams and SaaS API snapshots, writing schema-validated Parquet files into Apache Iceberg bronze tables. Apache Airflow orchestrates Snowflake ingestion and layered dbt Core transformations across dedicated virtual warehouses, while FastAPI services query curated Gold views via pooled Snowflake connectors and push operational metadata to a React governance console.
Flow: ERP, CRM & CDC Sources → Python Extraction Workers → Apache Iceberg Lakehouse (Bronze/Silver) → Apache Airflow + dbt Core (Snowflake Virtual Warehouses) → Curated Gold Marts → FastAPI Serving Layer → React Governance Portal & Client Apps
To avoid bloated full-table rebuilds, high-volume fact tables use dbt incremental microbatching keyed on ingestion watermarks. During CI/CD, pull requests automatically clone production metadata instantaneously in Snowflake, run modified dbt nodes plus downstream dependents, and tear down temporary schemas upon merge.
Technology Stack
| Category | Technology detail |
|---|---|
| Ingestion & Connectors | Python async extraction workers landing Parquet into object storage |
| Workflow Orchestration | Apache Airflow DAGs coordinating ELT, dbt runs, and SLA checks |
| Transformation & Modeling | dbt Core projects with incremental models, macros, and schema tests |
| Cloud Data Platform | Snowflake multi-cluster virtual warehouses with Dynamic Tables |
| Open Lakehouse Storage | Apache Iceberg tables backing bronze/silver layers for zero-lock-in access |
| Governed Serving Layer | FastAPI async microservices exposing curated metrics and query endpoints |
| Catalog & Governance UI | React portal displaying dbt lineage graphs, freshness, and cost telemetry |
| Data Quality & Contracts | dbt tests, schema drift detectors, and Python statistical assertions |
| Security & Access Policy | Snowflake RBAC, row-access policies, and dynamic PII column masking |
Engineering Trade-offs & Solutions
| Engineering Challenge | Solution & Trade-off |
|---|---|
| Full-table refreshes of multi-year fact tables inflated Snowflake credit burn | Converted heavy transformations to dbt incremental merge and delete+insert models partitioned by event date; adds watermark backfill logic in exchange for compact daily compute runs. |
| Rewriting complex legacy T-SQL procedures risked subtle rounding or join drift | Built an automated Python parity harness comparing legacy warehouse snapshots against Snowflake dbt marts per column prior to retiring old jobs; slowed early cutovers slightly while eliminating stakeholder trust gaps. |
| Direct FastAPI queries against large Snowflake tables risked cold-warehouse latency | Paired parameterized Gold summary views with response caching, query-tag routing to an always-warm small API warehouse, and async export endpoints for large payloads. |
| Mixing raw Python ML reads with SQL BI workloads caused governance fragmentation | Standardized Bronze/Silver storage on Apache Iceberg catalogs governed by unified RBAC policies, giving both engines consistent table snapshots without duplicate ETL pipelines. |
Security & Reliability
Enterprise data consolidation raises the stakes for access governance. The platform enforces Snowflake Role-Based Access Control (RBAC) separated cleanly across functional roles (ingestion, transformation, analyst, API service) and object-access roles. Dynamic data masking policies obfuscate PII fields—such as customer tax IDs, emails, and compensation figures—unless the querying identity carries explicit compliance clearance, while row-access policies restrict regional business units to their authorized territories.
FastAPI endpoints validate OAuth 2.0 / JWT tokens, translate tenant or department claims into bound query parameters (never string-interpolated SQL), and emit structured audit logs recording every dataset accessed. On the reliability front, Airflow DAGs implement idempotent task retries, circuit-breaking schema checks that halt bad upstream loads before corrupting Gold marts, and automated SLA alerts routed directly to on-call data engineers.
Performance & Scale
Workload isolation eliminates noisy-neighbor slowdowns across the data lifecycle. Ingestion, heavy dbt merges, interactive BI dashboards, and FastAPI operational queries each run on independently sized Snowflake virtual warehouses with tailored auto-scaling and aggressive auto-suspend policies. Clustering keys on high-cardinality filter columns—such as tenant ID and transaction date—keep micro-partition pruning sharp across multi-terabyte history.
Inside the FastAPI serving tier, async connection pooling, Pydantic response serialization, and short-TTL caching absorb bursty web portal traffic without waking extra Snowflake compute clusters unnecessarily. Query tagging links every executed SQL statement back to its originating Airflow DAG, dbt model, or API route, making performance tuning and FinOps attribution straightforward.
Operational Outcomes
Transitioning off brittle on-premise ETL onto a modular Python, dbt, Snowflake, Iceberg, and FastAPI architecture delivered lasting operational clarity:
- Trusted, version-controlled metrics: Finance, operations, and product teams consume a single set of tested dbt marts, ending cross-department disagreements over mismatched spreadsheets.
- Confident schema evolution: Pull-request CI runs against zero-copy Snowflake clones catch breaking SQL regressions and data-contract violations before production runs execute.
- Predictable cloud cost governance: Isolated warehouses, incremental models, and per-tag credit visibility replace opaque hardware bottlenecks with clear FinOps accountability.
- Application-ready analytics: Product engineers integrate curated warehouse insights into web portals safely through typed FastAPI endpoints instead of maintaining fragile database replicas.