Project · Data engineering · GCP
Trip Analytics on GCP
An end-to-end batch pipeline that turns raw taxi trip records into a star schema in BigQuery and an analytics dashboard in Looker Studio, orchestrated with Mage running on a Compute Engine VM.
01Architecture
- ExtractMage loads the raw trip CSV (pickup/drop-off times and locations, distances, fares, payment types).
- Transformpandas builds a star schema: one fact table and eight dimensions.
- LoadEach table is written to BigQuery, with project and dataset set by configuration.
- AnalyzeA SQL join produces one analytics table that feeds a Looker Studio dashboard.
02Data model
The transform step models NYC TLC trip records as a star schema so the dashboard can slice by time, location, rate and payment type without scanning raw rows.
- fact_table: one row per trip, with every fare component (fare, extra, MTA tax, tip, tolls, surcharge, total) and keys to each dimension.
- datetime_dim: pickup and drop-off timestamps broken into hour, day, month, year and weekday.
- rate_code_dim and payment_type_dim: numeric codes mapped to readable names.
- pickup_location_dim and dropoff_location_dim, plus passenger_count_dim and trip_distance_dim.
03Engineering notes
- Mage runs on a Compute Engine VM, so the ETL runs in the cloud rather than on a laptop.
- The BigQuery target project and dataset come from environment variables, so the same pipeline can deploy to any GCP project.
- The loader writes each table with replace semantics, so re-running the pipeline is safe.
Started as a guided learning project. Sources are credited in the repository.