Mason

Open sourceApache-2.0

A lightweight drop-in replacement for your Postgres read replica.

Same SQL, same answers. But extremely fast for analytical queries.

One query over 10 million rows: the Postgres primary took 15.7 seconds, Mason as its read replica took 0.193 seconds, and both returned the same answer to the same SQL: 81 times faster.
SELECT response_code, count(*)
FROM requests
GROUP BY response_code
Querying 10M rows
Postgres primary15.7s
Mason read replica0.193s

Same SQL, same answer, 81× faster

200: 7,412,604 rows (74.1%) 304: 1,502,931 rows (15.0%) 404: 846,118 rows (8.5%) 500: 238,347 rows (2.4%)
response_codecount
2007,412,604
3041,502,931
404846,118
500238,347

AWS m7g.xlarge · 4 vCPU · 16 GiB RAM · EBS gp3

Why Mason

Try it out in minutes, run it anywhere

$ npm i -g @mason-data/cli
$ cd my-app

# tell Mason which Postgres database to sync from
$ mason init 'postgres://me:secret@db.example.com:5432/my_db'

# choose the tables to sync
$ mason add orders customers

# start Mason locally and wait for the first sync to finish
$ mason start && mason wait

# get a connection URL for your favorite Postgres client
$ mason user add me

# get results fast
$ psql "postgres://me:<password>@localhost:5433/mason" -c "SELECT country, sum(amount) FROM orders JOIN customers ON customers.id = customer_id GROUP BY country"

# or give it to your coding agent
$ claude mcp add mason --env MASON_URL="postgres://me:<password>@localhost:5433/mason" -- mason mcp

# done? stop Mason and delete its synced copy of your data
$ mason stop && mason destroy

Self-host it →Try Mason Cloud Free →

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 and many columns, like looking up one order by its ID. Mason is fastest when you're querying a lot of rows across a few columns.

QueryPostgres (s)Mason (s)Mason is
Count by status10M rows, 10 clients21.7210.259584× faster
Count by status, 100M rows, 1 client216.0680.4624467× faster
SELECT status, count(*)
FROM orders
GROUP BY status
ORDER BY status
Revenue by month (a join)10M rows, 10 clients43.9092.75816× faster
Revenue by month (a join), 100M rows, 1 client335.0596.68550× faster
SELECT date_trunc('month', o.created_at) AS month,
       date_trunc('year', c.created_at) AS signup_year,
       sum(o.amount) AS revenue
FROM orders o
JOIN customers c ON c.id = o.customer_id
GROUP BY 1, 2
ORDER BY 1, 2
Lookup by primary key10M rows, 10 clients0.03880.23416.0× slower
Lookup by primary key, 100M rows, 1 client0.03660.10132.8× slower
SELECT *
FROM orders
WHERE id = '7c9e6679-7425-40de-944b-e07fc1f90ae7'

From a cold start: each engine restarted and the page cache dropped before every run. 1 or 10 clients send the query at the same moment, and the time is until every client has its answer, the median of 3 runs. Actual results will vary, depending on the size and distribution of your data.

How it was measuredAWS m7g.xlarge · 4 vCPU · 16 GiB RAM · EBS gp3

Features

The Overview page of mason ui. It shows that Mason is ready, with all 4 tables synced, how many rows and queries there are, and no errors in the last day.
The Overview page shows you that Mason is ready, and how your tables and queries are doing.
The Queries page of mason ui. It lists each query with its status, when it started, how long it took, the user and tool that sent it, the rows it returned and its SQL.
The Queries page shows you every query, who sent it and how long it took.