← Tue, Nov 24 digest

Show HN: Mason – A lightweight Postgres read-replica, built on columnar storage

read article ↗ hn thread ↗

Mason is a lightweight drop-in Postgres read replica powered by DuckDB that accelerates analytical queries up to 467 times.

summary is enough The idea is clever and well-executed, but the core mechanism—syncing via CDC into DuckDB with automated query rewriting—is straightforward enough to grasp from the landing page.

summary

Mason provides a drop-in Postgres read replica built on a local DuckDB columnar storage engine designed for fast analytical queries, dashboards, and AI agents. It handles synchronization from Postgres via polling or logical replication and automatically translates Postgres SQL queries into DuckDB-optimized syntax. Benchmarks show significant speedups on aggregations and group-bys compared to standard Postgres, though primary key lookups are slightly slower. It also includes built-in role-based access control, row-level security, and an MCP server for AI tooling.

key points

  1. Syncs data locally from a Postgres database into DuckDB using polling, on-demand, or logical replication (WAL CDC).
  2. Translates standard Postgres queries on the fly to match DuckDB's fast execution paths, achieving up to 467x speedups on large group-by queries.
  3. Built for AI agent workflows with native Model Context Protocol (MCP) support, role-based access control, and row-level security.
  4. Runs as a single Node.js process and includes a CLI and web UI for local management.

who should read it

Backend engineers and data platform developers looking to speed up heavy analytical queries and agent interactions without spinning up a complex data warehouse.

discussion warm

consensus

Commenters are enthusiastic about the use of DuckDB as a lightweight analytical replica, noting it avoids the operational complexity of heavy systems like ClickHouse.

pushback

One user questioned why a dedicated tool is necessary instead of querying Postgres directly via ADBC, prompting the author to clarify that Mason handles continuous replication and query rewriting to protect the primary database.

best comment by tagspace ↗

Good question. The majority of the work was two things:

1. the replication logic that keeps duckdb in sync with your postgres (like you'd expect from a read replica)

2. the query rewriter that takes incoming postgres queries and turns them into queries that run fast on duckdb (we've spent a lot of time making sure that most queries are answered in a few 100 milliseconds, even on 10+M rows).

So, I guess the main differences are:

- with ADBC the load still hits your postgres (which is what we wanted to avoid)

- with ADBC you're not guaranteed to get the same answer as postgres (we want …

The author explains the specific engineering challenges solved by the tool, focusing on the automated replication logic and the custom query rewriter.

Generated by an LLM from the article and thread. Check the sources before relying on it.