Scripts2026年9月12日·1 分钟阅读

ReadySet — Wire-Compatible SQL Caching for Postgres and MySQL

A lightweight SQL cache that sits between your application and database, automatically keeping query results fresh using the replication stream.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
ReadySet
直接安装命令
npx -y tokrepo@latest install 59bd7fe6-aeaa-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

ReadySet is a SQL caching engine that drops in between your application and your PostgreSQL or MySQL database. It speaks the native wire protocol, so no code changes are required. Queries you choose to cache are served from an in-memory dataflow graph that stays up to date automatically by tailing the database replication stream.

What ReadySet Does

  • Proxies the Postgres or MySQL wire protocol so applications connect without driver changes
  • Caches selected query results in memory and updates them incrementally from the binlog or WAL
  • Reduces read latency and database load without application-level cache invalidation logic
  • Provides a SQL command interface to inspect and manage which queries are cached
  • Falls through to the upstream database for uncached or unsupported queries transparently

Architecture Overview

ReadySet uses a streaming dataflow engine inspired by the Noria research project. When a query is marked for caching, ReadySet compiles it into a dataflow graph of operators. The replication stream from the upstream database feeds change events into this graph, and the operators incrementally maintain materialized views in memory. Reads hit the materialized state directly, avoiding a round-trip to the origin database.

Self-Hosting & Configuration

  • Deploy as a single binary or Docker container between your app and database
  • Set UPSTREAM_DB_URL to point at the existing Postgres or MySQL instance
  • Run SHOW PROXIED QUERIES to see which queries are flowing through
  • Cache a query with CREATE CACHE FROM followed by the query fingerprint
  • Monitor memory usage and cache hit rates through built-in metrics endpoints

Key Features

  • Zero application code changes — compatible with existing Postgres and MySQL drivers
  • Automatic incremental cache maintenance via replication, no TTL or manual invalidation
  • Sub-millisecond reads for cached queries, even under high write throughput
  • Query-level control over what gets cached and what passes through
  • Snapshot and streaming replication support for initial state and ongoing changes

Comparison with Similar Tools

  • Redis / Memcached — general key-value caches; ReadySet caches SQL results with automatic invalidation
  • Materialize — full streaming SQL database; ReadySet is a transparent proxy layer
  • ProxySQL — MySQL query routing and caching; ReadySet maintains incrementally updated views
  • PgBouncer — connection pooling only; ReadySet adds a caching data plane
  • Amazon ElastiCache — managed Redis/Memcached; ReadySet eliminates manual cache logic

FAQ

Q: Do I need to change my application code to use ReadySet? A: No. ReadySet speaks the Postgres or MySQL wire protocol. Point your connection string at ReadySet instead of the origin database and it works transparently.

Q: How does ReadySet keep cached data fresh? A: It tails the database replication stream (WAL for Postgres, binlog for MySQL) and incrementally updates its in-memory views as writes happen upstream.

Q: What happens if ReadySet goes down? A: Queries fall through to the upstream database. When ReadySet restarts, it re-snapshots the relevant tables and resumes streaming replication.

Q: Which SQL queries can ReadySet cache? A: Most SELECT queries with joins, filters, and aggregations are supported. Complex features like recursive CTEs or window functions may fall through to the upstream database.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产