Readyset Docs

What is QueryPilot?

QueryPilot is a SQL proxy platform. Only the Router is required; caching and policy enforcement 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 and enforces policies on agentic traffic with Guard, keeping your database focused on serving your application. 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 is 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 three 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

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

GA v1 ships the Router and the Accelerator. Guard is an upcoming feature; it is 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, rewriting a function call the target backend does not support into its equivalent. 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.
  • 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.

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 + 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.
MySQL proxying (wire protocol and backends)Preview. Tested against MySQL 8.0.
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.