Mason is an open-source, Apache-licensed service designed to act as a lightweight read replica for PostgreSQL, especially for analytical workloads. It syncs selected tables and columns from a Postgres database into DuckDB’s columnar engine, then accepts familiar Postgres SQL and adapts queries for faster execution. Data can be refreshed on demand, by polling, or through logical replication. In a cited test on a four-vCPU, 16-GiB machine, a group-by query over 10 million rows took 15.7 seconds on Postgres and 0.193 seconds on Mason, with identical results. Other benchmarks report gains of 16 to 467 times for large aggregations and joins, depending on the test. These figures are workload-specific: primary-key lookups were roughly three to six times slower on Mason.
The intended use is read-heavy reporting, dashboards, and queries from AI agents, rather than fetching a small number of wide records. Mason runs as a single Node.js process, stores its configuration and synchronized data locally, and can be installed and connected through a command-line setup. It also includes per-user access controls, row-level restrictions, query and sync logs, generated tables, monitoring endpoints, TLS and IP allowlists, and a web interface. Built-in MCP support lets agents query permitted data, with activity recorded for review. Users choose what data to replicate and can remove the local copy when finished. The core proposition is to preserve a Postgres-compatible interface while improving scans and aggregations, accepting slower point lookups and the operational responsibility of managing a separate synchronized copy.
Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.