Readyset Docs

What is QueryPilot?

QueryPilot is a SQL proxy platform with four components. Only the Router is required; caching, policy enforcement, and analytics are opt-in.

QueryPilot is a SQL proxy built for modern workloads. It speaks the PostgreSQL and MySQL wire protocols on the front; behind them it accelerates query processing with automatic caching, enforces policies on agentic traffic with Guard, and splits analytics queries off to Analytics so your database stays focused on transactional work. Applications keep their existing drivers, SQL, and credentials; they change only the host and port they connect to.

MySQL support is in preview. MySQL proxying and MySQL CDC are functional and documented, but they are not part of the GA v1 support surface. PostgreSQL is the fully supported GA v1 path; full MySQL support is a fast-follow.

The platform is four components:

ComponentWhat it isShips as
RouterThe SQL proxy: wire protocols, connection pooling, query routing and translation, plugin host, metrics and admin APIbinary querypilot
AcceleratorCaching plugin: discovers hot queries and manages Readyset caches plus the routing rules that send traffic to themin-process plugin inside querypilot, or standalone binary querypilot-accelerator
GuardPolicy-enforcement plugin: trust levels, YAML policies, a trusted-query registry, and an audit log for every decisionin-process plugin inside querypilot
AnalyticsDuckDB-backed analytics server with CDC replication from an upstream PostgreSQL or MySQL databasebinary querypilot-analytics

Only the Router is mandatory. Each of the other three is opt-in and independent of the others.

GA v1 ships the Router and the Accelerator. Guard and Analytics are upcoming features; they are documented here ahead of availability and details may change before release.

Architecture

QueryPilot architectureApplicationsany PostgreSQL or MySQL driver, no code changesPostgreSQL wireMySQL wireRouterbinary querypilotmetrics :9090  /  admin API :9091PLUGIN CHAIN (OPT-IN)Guard*allow / amend / block / auditAcceleratorcache discovery, rule managementQUERY ROUTINGTransaction pinningin-flight transactions stay putRule matchingtranslation · pattern · regexRead / write splitreads → replicas, writes → primaryCONNECTION POOLSsession / transaction / statement modes  ·  per-pool credentials and protocolpg-poolmysql-poolanalytics-poolcache-poolPostgreSQLprimary / replicasMySQL*primary / replicasAnalytics*querypilot-analyticsAcceleratorReadyset cachesCDC replication: snapshot first, then live changes* Coming soon

The Router

The Router (binary querypilot) is the core of the platform and the only required process. It is configured by a single TOML file, querypilot.toml (see the configuration reference).

  • Wire protocols. Each [[listeners]] entry serves either the PostgreSQL or the MySQL protocol. A single Router can serve both at once on different ports.
  • Connection pooling. Named [pools.<name>] hold connections to backend servers, with three modes: session (connection held for the whole client session), transaction (released at COMMIT/ROLLBACK, the default), and statement (released after every statement). Backends within a pool are selected round-robin, and replicas can be skipped when their measured lag exceeds max_replica_lag.
  • Query routing. For each query the Router first honors transaction pinning (in-transaction statements stay on the same backend connection), then translation rules, then pattern rules, then regex rules, then the read/write split, falling back to default_pool.
  • Query translation. Translation rules rewrite a query's SQL and pin it to a target pool, for example rewriting MySQL JSON_OVERLAPS(...) into DuckDB list_has_any(...). Literals are parameterized on both sides, so one rule covers every query with the same shape regardless of values.
  • Cross-protocol pools. A pool can override the backend protocol, so a MySQL client can be served transparently from a PostgreSQL-speaking backend (including Analytics).
  • Observability and control. With [metrics] enabled = true the Router serves Prometheus metrics (sqp_* series) and a REST admin API on the same IP at the metrics port + 1 (9090 metrics / 9091 admin by convention).

Accelerator

The Accelerator watches query traffic, ranks the hottest queries, creates caches for them on a Readyset deployment, and installs the routing rules that steer matching queries to the Readyset pool. It runs in two forms: in-process, enabled by a [plugins.accelerator] block in querypilot.toml, or standalone as the querypilot-accelerator binary managing a ProxySQL or Router deployment. See the Accelerator guide.

Guard

Guard is an in-process plugin enabled by a [plugins.guard] block in querypilot.toml. It assigns each session a trust level, evaluates YAML policies and a trusted-query registry against every query, and can allow, amend, or block, or run in shadow/warn mode that only records what it would have done. Every decision is written to an audit sink. See the Guard guide.

Analytics

Analytics (binary querypilot-analytics) is a separate server process that embeds DuckDB and exposes it over the PostgreSQL wire protocol. Its [replicator] section performs CDC replication from an upstream database, taking a snapshot of existing data first and then streaming changes, so DuckDB holds a continuously updated copy of the configured tables. See the Analytics guide.

How the components compose

  • Router alone is a protocol-aware pooling proxy with routing rules: read/write splitting, query rejection, multi-pool fan-out.
  • Router + Analytics is the HTAP setup: Analytics replicates your tables into DuckDB, and to the Router it is simply another PostgreSQL backend in a pool. Analytical reads route to DuckDB; writes and point lookups stay on the source database. The deployment guide ships this shape.
  • Router + Accelerator (+ Readyset) adds automatic caching: the plugin creates Readyset caches for hot queries and routes matching traffic to them.
  • Guard layers policy enforcement onto any of the above.

Plugins are opt-in via their config blocks; when none are enabled the plugin chain is empty and adds zero per-query overhead.

Compatibility

SurfaceGA v1 status
PostgreSQL proxying (wire protocol and backends)GA. Tested against PostgreSQL 15 and 16.
PostgreSQL CDC into AnalyticsUpcoming, ships with Analytics. Requires wal_level = logical on the source.
MySQL proxying (wire protocol and backends)Preview. Tested against MySQL 8.0.
MySQL CDC into AnalyticsUpcoming, preview. Requires GTID mode on the source.
Client authenticationPostgreSQL SCRAM-SHA-256; MySQL mysql_native_password.
Client driversAny driver speaking the PostgreSQL or MySQL wire protocol. Proven in tests with psql, mysql, and standard Rust drivers; prepared statements are supported on both protocols.
PlatformsLinux amd64 and arm64 container images.

The Router does not terminate TLS in GA v1. Run it on a trusted network segment and terminate TLS in front of it if clients connect over untrusted networks. See Security.