Data & Analytics · Data Engineering & Analytics
US Flight Operations Intelligence
An end-to-end aviation analytics platform built on 5.82M 2015 US DOT flight records in PostgreSQL, resolving an October 2015 airport ID anomaly and serving a bilingual (TR | EN) Streamlit + Plotly dashboard.

Purpose
US Flight Operations Intelligence transforms the 2015 US Department of Transportation (DOT / BTS) domestic flight dataset (5,819,079 records across 12 months and 14 airlines) from raw CSV tables into a verified PostgreSQL analytical layer and an interactive, bilingual (TR | EN) operations dashboard.
Rather than stopping at static exploratory charts, the project was developed across 11 structured engineering sprints covering raw data profiling, airport identifier reconciliation, SQL view design, query-plan performance tuning, and a custom dark-navy Streamlit + Plotly user interface.
Problem
During early data-quality audits, airport and corridor aggregations exposed a silent schema drift in the source dataset:
- October 2015 Airport Identifier Anomaly: For October 2015 only (486,165 flight records),
origin_airportanddestination_airportwere encoded as 5-digit numeric DOT Airport IDs (such as10397instead ofATL) rather than 3-letter IATA codes. Joiningflightsdirectly toairportssilently dropped 100% of October airport and route records from rankings and monthly heatmaps. - Query Performance Bottlenecks on 5.82M Rows: Unfiltered airport and route queries originally joined the normalized flight view to
public.airportsbeforeGROUP BY, causing PostgreSQL to misestimate group cardinality and scan the full table multiple times per page load (13–27 seconds per query; ~58.7 s cold Airport Intelligence page load).
Solution & Approach
- Non-Destructive Reconciliation (
public.flights_normalized): Built and validated an official 307-row October 2015 DOT Airport ID → IATA crosswalk (public.airport_id_iata_crosswalk), verified with 20 / 20 passing read-only SQL assertions, and exposed normalized endpoints through a non-destructive SQL view without mutating raw source rows. - Read-Only Parameterized Data Layer: Centralized database access through a singleton SQLAlchemy 2.0 +
psycopg2connection pool (python/db_connect.pyanddashboard/data_access.py) enforcingSET TRANSACTION READ ONLY, parameterized queries, and 5-minute TTL caching (@st.cache_data). - Query-Plan Optimization (Sprint 9): Used plan-only
EXPLAINdiagnostics to aggregate by normalized IATA code before joiningpublic.airports, share cached aggregates across ranking and metric functions, canonicalize set-filter cache keys, and short-circuit empty selections—achieving 100% verified analytical equivalence with zero schema changes. - Bilingual Interactive Interface (Sprint 10): Built a 6-page Streamlit + Plotly application with 21 interactive charts, a unified hover-tooltip builder, and a persistent
TR | ENlanguage switcher covering 219 localized UI keys.
Key Features
- Executive Overview: Five validated KPI cards (
5,819,079flights,9.37 minavg departure delay,4.41 minavg arrival delay,1.54%cancellation rate,0.26%diversion rate), peak-month callout banner, monthly volume and delay trend charts, and carrier performance bubble matrix. - Flight Operations: Monthly operating volume, source
day_of_weeknumeric distribution, scheduled departure-hour delay curve (00–23), cancellation/diversion trends, and carrier volume breakdown. - Airport Intelligence: Normalized top origin and destination hubs, departure-delay hub rankings (
>50,000flight eligibility threshold), supplemental arrival rankings, and an airport-by-month departure-delay heatmap with full October coverage. - Route Intelligence: Top 15 domestic corridors by volume, top 30 route delay profile scatter plot, top 10 monthly corridor trends, and interactive origin/destination airport selectors.
- Delay Analysis: FAA 5-cause attribution donut paired with a ranked summary card covering 994,254 attributed delay hours (Late Aircraft
41.84%, Airline Operations33.76%, Air System/NAS19.09%, Weather5.17%, Security0.14%), stacked monthly delay causes, and 30-minute delay distributions. - Data Quality: Side-by-side verification comparing the audited Sprint 5 reconciliation baseline (
486,165October rows,307crosswalk mappings,20 / 20 PASS) against live read-only PostgreSQL checks.
Technologies & Tools
- Database & SQL: PostgreSQL, SQL Views (
public.flights_normalized), Crosswalk DDL, Read-Only Validation Assertions. - Data Access & Processing: Python 3.10+, SQLAlchemy 2.0,
psycopg2-binary, Pandas, NumPy,python-dotenv. - Interactive App & Charts: Streamlit (
>=1.36,<2.0), Plotly (>=5.18,<7.0), custom CSS dark-navy design tokens, centralized TR/EN localization (dashboard/i18n.py). - Static Visualization: Matplotlib, Seaborn, Pillow for standalone normalized heatmap scripts and README visual assets.
Visual Showcase






Outcomes & Takeaways
Validated Baseline & Measured Optimization
| Metric / Benchmark | Validated Result | Notes |
|---|---|---|
| Total 2015 Flight Records | 5,819,079 | Full-year count on public.flights_normalized |
| October 2015 Reconciliation | 486,165 / 486,165 (100%) | 307 / 307 DOT ID → IATA mappings, 0 unresolved |
| Airport Intelligence Cold Load | ~58.70 s → 11.73 s | ~5.0× faster cold; 0.15 s warm cache |
| Route Intelligence Cold Load | ~39.75 s → 22.46 s | ~1.8× faster cold; 0.13 s warm cache |
Known Limitations & Engineering Lessons
- Honest Scope Constraints: The dataset covers calendar year 2015 only and requires a local PostgreSQL instance (raw CSVs are excluded to keep the repository lightweight). Because
public.flightsintentionally carries zero database indexes in the current schema, cold full-year route queries still take ~11 s on first visit before hitting the 5-minute cache. - Key Takeaway: Auditing reference integrity before charting caught an entire missing month of hub data, and keeping reconciliation in a non-destructive SQL view made every downstream SQL query, Matplotlib chart, and Streamlit view consistent from a single source of truth.