Readyset Cache
Deploy Readyset, add shallow caches for specific queries, and benchmark upstream vs cache head-to-head.
RDST doesn't just diagnose slow queries — it deploys Readyset caches and lets you benchmark the result.
What is Readyset?
Readyset is a real-time SQL cache that sits between your application and your database. It speaks the wire protocol of Postgres and MySQL, so applications connect to it the same way they connect to the primary database. Queries that match a configured cache are served from Readyset at memory speed; everything else is forwarded to the upstream database.
For background, see Readyset docs.
Shallow caching vs deep caching
| Shallow cache | Deep cache (QueryPilot only) | |
|---|---|---|
| What's stored | Parameterized query results with a TTL | Incrementally-maintained result set, always fresh |
| Invalidation | TTL-based | Streaming dataflow from upstream |
| RDST manages | Yes | No (use QueryPilot instead) |
| Best for | Read-heavy queries that tolerate small TTLs | Read-heavy queries that require strong freshness |
rdst cache commands manage shallow caches. If you need deep caching with
strict freshness guarantees, use Readyset QueryPilot.
The RDST cache workflow
The typical flow is deploy first, then cache queries, then measure:
- Deploy Readyset.
rdst cache deploy --target prod-orders --mode dockerstarts a Readyset process (locally, remote via SSH, or in Kubernetes) and registers a new target for it, named<original>-cache. - Add caches for specific queries. Pass a hash from the query registry to
rdst cache add— typically one you found withrdst toporrdst analyze. - Measure the impact.
rdst query cache-compareruns the same query against the upstream database and the cache head-to-head and reports the delta.
Two other commands offer to deploy a cache for you, so you often won't run
rdst cache deploy directly:
rdst initandrdst configure addprompt you at the end of target setup.rdst audit --durationprompts before benchmarking captured queries.
If you accept either prompt, you can skip step 1 here.
# 1. Deploy
rdst cache deploy --target prod-orders --mode docker
# 2. Find a query to cache and add it
rdst top --target prod-orders
rdst cache add a1b2c3d4e5f6 --target prod-orders-cache
# 3. Measure
rdst query cache-compare a1b2c3d4e5f6 --target prod-orders --count 500Deployment modes
rdst cache deploy supports three modes, each appropriate for a different
environment:
| Mode | Use when |
|---|---|
docker | You want the simplest path — a local or remote Readyset container |
systemd | You have a dedicated host for Readyset (EC2, bare metal, etc.) |
kubernetes | Your infrastructure runs on K8s and you want Readyset there too |
Combined with --host (for remote deployment via SSH) and --script-only
(generate the deploy script without running it), this gives you four real flows:
# Local Docker
rdst cache deploy --target prod-orders --mode docker
# Remote host via SSH
rdst cache deploy --target prod-orders --mode docker \
--host 10.0.1.50 --ssh-user ubuntu --ssh-key ~/.ssh/prod.pem
# Systemd service
rdst cache deploy --target prod-orders --mode systemd
# Kubernetes
rdst cache deploy --target prod-orders --mode kubernetes \
--namespace readyset --kubeconfig ~/.kube/config
# Generate the script without executing
rdst cache deploy --target prod-orders --mode docker --script-onlySee rdst cache deploy for the full reference.
Sections in this guide
rdst cache deploy
Deploy Readyset locally, remotely via SSH, or in Kubernetes.
Managing caches
Add, list, delete, and tear down caches on a deployed Readyset instance.
Benchmarking with cache-compare
Measure upstream vs cached performance head-to-head with real traffic.
See also
rdst audit— the audit report ranks Readyset cache candidates across your databaserdst analyze— per-query cache-fit evaluation- Readyset QueryPilot — fully-managed caching on top of Readyset, when you want auto-discovery and deep caching