Skip to main content
Version: Next

QueryFlux architecture documentation

This section describes how QueryFlux is put together: why it exists, how SQL is translated, and how traffic is routed to cluster groups and individual clusters.

DocumentWhat it covers
Motivation and goalsProblem statement, goals, and how QueryFlux fits multi-engine estates.
System mapEnd-to-end query lifecycle, major crates, and component status (high level).
Query translationDialect detection, sqlglot integration, when translation runs, and schema-aware mode.
Routing and clustersRouter chain, routingFallback, cluster groups, load-balancing strategies, and queueing.
Cluster variants, health & reconcileMulti-warehouse expansion, ADBC introspection, custom health/reconcile SQL, distributed capacity.
Query tagsAttaching metadata to queries for routing, observability, and backend forwarding.
Query parametersTyped positional bindings — how ? params flow from frontend to native engine APIs.
ObservabilityPrometheus metrics, Grafana dashboard, QueryFlux Studio, and the Admin REST API.
GuardrailsSQL-shape safety checks (read-only, LIMIT, Python guards).
Access controlTable/column allow-deny, row filters, masks, and customer API use case via OPA.
FrontendsProtocol listeners — Trino HTTP, PostgreSQL wire, MySQL wire, Flight SQL, and more. Shared dispatch, session model, and per-protocol details.
Extending QueryFluxBackend (Rust + Studio) and Frontend (new protocols).
Auth / authz designAuthentication and authorization design notes.

Start with Motivation and goals if you are new to the project; use System map as the single-page map of the system.

The canonical Markdown sources live under docs/ in the repository.