Insights_Factory Analytics Pipeline
An AWS S3 → Snowflake ELT pipeline built with dbt. Transforms booking, listing, and host data through Bronze, Silver, and Gold layers into a star schema with SCD Type 2 snapshots, incremental MERGE loads, metadata-driven SQL, and 40 data quality tests.
Project-specific results. The case study below describes the workload and approach.
40
Data Quality Tests
3
SCD Type 2 Dimensions
5,000
Bookings Processed
40
Data Quality Tests
3
SCD Type 2 Dimensions
Overview
Built during my Data Engineer role at Insights Factory Pvt Ltd, Insights_Factory is an end-to-end production ELT pipeline that loads raw booking, listing, and host CSV data from AWS S3 into Snowflake, then uses dbt to build Bronze, Silver, and Gold layers. The pipeline processes 5,000 bookings and 500 listings, enriches business metrics, and creates an analytics-ready star schema with three SCD Type 2 snapshot dimensions and a fact table. Reusable Jinja macros, metadata-driven joins, and 40 defined data tests keep the transformations traceable and maintainable.
Tech Stack
- Status
- Production Ready
- Platform
- Snowflake
- dbt
- 1.12.6
- Python
- 3.13
- Architecture
- Medallion + Star Schema
- Author
- Naveed Bhat
Cloud Data Warehouse
Snowflake
Compute and storage for the INSIGHTS_FACTORY database.
Transformation Layer
dbt Core
1.12.6Models, snapshots, macros, and data tests.
Snowflake Adapter
dbt-snowflake
1.12.4Connects dbt to the Snowflake warehouse.
Cloud Storage
AWS S3
Raw CSV files in snowbucketnavii/source/, loaded through a Snowflake external stage.
Runtime
Python
3.13Required runtime for dbt.
Package Manager
uv
latestVirtual environments and dependency management.
Version Control
Git + GitHub
Source control and remote repository hosting.
Topics
- dbt
- Snowflake
- Data Engineering
- ELT
- Star Schema
- SCD Type 2
- Medallion Architecture
- Jinja Macros
Technical Architecture
AWS S3 → Snowflake staging → Bronze → Silver → Gold. dbt manages model dependencies, schema routing, snapshots, and tests throughout the transformation graph.
AWS S3 & Snowflake Staging
Raw CSV storage, external stage, and COPY INTO
Bronze & Silver Models
Incremental ingestion, MERGE upserts, and enrichment
Gold Analytics
One Big Table, snapshot dimensions, and fact table
Reusable Macros
Schema routing, watermarks, safe division, and cleansing
Data Quality
30 generic checks and 10 business-rule SQL tests
Medallion Architecture
Bronze models ingest staging data with incremental watermark filters and Snowflake MERGE upserts. Silver models apply type casting, financial calculations, and quality flags. Gold joins the enriched data into a 5,000-row, 34-column One Big Table before building the analytical schema.
Star Schema & SCD Type 2
Ephemeral dbt models compile into CTEs that feed booking, host, and listing snapshots without creating intermediate warehouse objects. Timestamp-based SCD Type 2 snapshots record dimension versions, and the fact model joins the OBT to those dimensions.
Metadata-Driven SQL
Jinja configuration lists drive the OBT and fact-table joins. dbt source() and ref() declarations express lineage, while five shared macros handle schema names, incremental lookback windows, safe division, categorization, and text cleansing.
40 Data Quality Tests
Thirty generic tests check uniqueness and required values across sources and models. Ten singular SQL tests cover business rules including non-negative amounts, valid booking states, positive stay durations, booking grain, orphan records, and total-amount formulas.
Pipeline at a Glance
Bookings
5,000
Listings
500
Data Tests
40
SCD2 Dimensions
3
Results & Impact
Analytics-Ready Booking Data
Transforms three source datasets into a booking-grain fact table and related dimensions for downstream analysis.
Traceable Transformations
dbt model references expose lineage from raw staging tables through every layer of the warehouse.
Explicit Quality Rules
Generic and singular tests make key constraints and financial business rules part of the pipeline.
“From raw bookings to analytics-ready data, with quality checks at every layer.”
Up next — NutriPump Artisanal
