A lightweight drop-in replacement for your Postgres read replica.
Same SQL, same answers. But 10–50× faster for analytical queries.
Try it out locally, run it anywhere
$ npm i -g @mason-data/cli
$ cd my-app
# tell Mason which Postgres database to sync from
$ echo "MASON_DATABASE_URL=postgres://me:secret@localhost:5432/my_db" >> .env
$ mason init
# choose the tables to sync
$ mason add orders customers
# start Mason and wait for the first sync to finish
$ mason start && mason wait
# get a connection URL for your favourite Postgres client
$ mason user add me
# get results 10–50× faster
$ psql "postgres://me:<password>@localhost:5433/mason" -c "SELECT country, sum(amount) FROM orders JOIN customers ON customers.id = customer_id GROUP BY country"
Why Mason
- Lightweight: Mason is a single Node.js process you can run anywhere. It keeps all its config and your synced data locally in the folder you run it in.
- Fast: Mason syncs your Postgres data into DuckDB's columnar engine, and rewrites your Postgres queries on the fly into the form DuckDB runs fastest.
- Postgres: Mason is built from the ground up to match Postgres's syntax and behaviour (not DuckDB's), so you can point your existing Postgres queries at it with confidence.
- Read replica: You choose which tables and columns to sync from your Postgres database, and how each stays in sync: on demand, by polling or by logical replication.
- Built for AI agents: Add a user per agent, with role-based access control (RBAC) that limits the tables, columns and rows each one can read. Every query is logged with who ran it, the SQL they sent, how long it took and, if it was refused, how to fix it. Mason also has MCP support built in.
Where Mason is fast, and where it isn't
Fast
Queries that read lots of rows, like counts, sums and group-bys over big tables. The kind dashboards, reports and AI agents run.
Not fast
Queries that fetch a few rows, like looking up one order by its ID. Keep those on Postgres. Writes stay there too, because Mason is read-only.
| Measured | Postgres p95 (s) | Mason p95 (s) | Mason is |
|---|---|---|---|
| Dashboard queries 1 M rows, 8 concurrent clients | 2.06 | 0.14 | 15× faster |
| Dashboard queries 30 M rows, 8 concurrent clients | 258.00 | 4.53 | 57× faster |
| Dashboard queries 10 M rows, 32 concurrent clients | 96.60 | 3.51 | 28× faster |
| Lookup by ID 30 M rows, 8 concurrent clients | 0.02 | 2.09 | 91× slower |
How it was measuredAWS m7g.xlarge · 4 vCPU · 15 GiB RAM · EBS gp3