· via Hacker News – Front Page (native)
Mason open-sources a columnar Postgres read replica with claimed 80x analytics speedups
Mason, an Apache-2.0 Postgres read replica built on DuckDB's columnar engine, claims an 81x speedup on a 10-million-row aggregation and ships with RBAC and MCP support for AI agents.

What Mason is
Mason, a new open-source project introduced on Hacker News under the Apache-2.0 license, describes itself as a drop-in replacement for a Postgres read replica: same SQL, same answers, but dramatically faster on analytical workloads because the data lives in columnar storage instead of Postgres's row-oriented layout.
The headline number on the project's site: a GROUP BY aggregation over 10 million rows of a requests table took 15.7 seconds on the Postgres primary and 0.193 seconds on Mason, an 81x speedup with identical results. The benchmark ran on an AWS m7g.xlarge instance with 4 vCPUs and 16 GiB of RAM.
How it works
Mason is a single Node.js process that keeps its configuration and its synced copy of your data in whatever folder you run it in. Under the hood it syncs Postgres data into DuckDB's columnar engine and rewrites incoming Postgres queries on the fly into the form DuckDB executes fastest. The project stresses that it emulates Postgres syntax and behavior rather than DuckDB's, so existing queries should work unmodified.
You choose which tables and columns to sync and how each stays current: on demand, by polling, or via logical replication. Setup is a short CLI sequence — install @mason-data/cli globally, run mason init with a Postgres connection string, mason add the tables you want, then mason start and mason wait. Mason then serves a Postgres-compatible connection on port 5433 that any standard Postgres client can use. A hosted Mason Cloud tier has a free option alongside self-hosting.
Where it wins, and where it loses
The project is unusually candid about its weak spot. Mason is fast on queries that scan lots of rows — counts, sums, group-bys and joins over big tables, the shapes dashboards, reports and AI agents produce. It is slow on queries that fetch a few rows across many columns, like fetching one order by ID.
The published benchmarks reflect exactly that. A count-by-status query over 10 million rows with 10 concurrent clients ran 84x faster on Mason (21.72s versus 0.259s), and over 100 million rows with a single client it was 467x faster (216.07s versus 0.462s). A revenue-by-month join gained 16x at 10 million rows and 50x at 100 million. But a primary-key lookup was 6x slower on Mason at 10 million rows (0.234s versus 0.0388s) and 2.8x slower at 100 million. The project notes that every run started cold, with each engine restarted and the page cache dropped, that 1 or 10 clients issued the query simultaneously and the median of three runs was recorded, and it cautions that actual results will vary with data size and distribution.
Designed for AI agents
A distinguishing feature is agent access. Mason supports one user per agent, with role-based access control restricting which tables, columns and rows each can read. Row-level security can confine a user to its own rows, and Mason extends that limit across related tables by following foreign keys. Every query is logged — who ran it, the SQL, how long it took, and if it was refused, how to fix it. An MCP server is built in, so agents such as Claude Code and ChatGPT can browse tables and run queries within the bounds of their role; the docs show registering Mason with Claude Code in one command.
Operational surface
Other capabilities include generated tables, which act like materialized views that Mason keeps up to date without adding load to the source database; a /metrics endpoint for Prometheus and Grafana and a /healthz endpoint for Kubernetes, ECS and uptime checks; logs written to stdout for Datadog or CloudWatch; per-user IP allowlists; TLS on every connection; and a web UI launched with mason ui for managing tables and users and watching queries and sync events live. Commands like mason logs and mason usage give retrospective visibility into query history and sync activity.
Why it matters
Postgres is routinely asked to serve both transactional traffic and the analytical queries that stress its row storage most, and teams often solve this by shipping data to a separate warehouse. Mason proposes a lighter middle path: keep Postgres as the source of truth and bolt on a columnar sidecar for the heavy scans, with sync handled for you. The agent-oriented controls — per-user RBAC, row-level security, query logs, MCP — address a genuine current gap around letting LLM agents touch production databases safely.
The caveats are real: the benchmarks are the project's own, the biggest multipliers depend on cold caches and scan-heavy query shapes, and point lookups are strictly worse than on Postgres, so Mason is a complement to your primary rather than a replacement. But for dashboards and reporting currently hammering a Postgres replica, an Apache-2.0 tool that installs via npm and runs as a single process is an easy thing to test.
- #postgres
- #duckdb
- #open-source
- #databases
- #analytics
- #mcp