Flights Reference API
A Rust HTTP API over a unified flights reference database — 3.3M flights, 38k routes, 8.5k airports — built by merging OpenFlights and the historical FlightDB schedule archive into a single Postgres schema. Deployed to Oracle Cloud Free Tier with no public inbound IP: all ingress runs through a Cloudflare Tunnel.
The API provides a unified reference for flight schedules, routes, and airport data by merging two public datasets — OpenFlights and FlightDB — into a single Postgres schema. OpenFlights covers 8,578 airports with IATA and ICAO codes; FlightDB adds 3.4 million historical flights with its own airport table. The importer reconciles them through a three-tier match precedence (IATA code, then ICAO code, then a fallback code), flagging each record by its source and merging matching entries to fill null columns. Records with conflicting identifiers are handled gracefully — the importer catches constraint violations, strips the conflicting codes, and retries.
The API itself is built in Rust with axum and sqlx, serving flight lookups, route searches, and one-stop connection queries against the merged dataset. The pre-aggregated routes table (38k rows) makes multi-hop searches efficient without scanning the full 3.7 million-row legs table.
Infrastructure runs on an Oracle Cloud free-tier VM with zero inbound firewall rules — all traffic routes through Cloudflare Tunnel, which handles both HTTP and SSH ingress. This avoids the reliability issues of Oracle’s residential-grade IP addresses and eliminates the need for TLS certificate management. The entire stack is defined in Terraform and deploys via a minimal cloud-init bootstrap, with everything past initial provisioning handled by post-SSH scripts.