# Mason – A lightweight Postgres read-replica, built on colum…

Hi HN! TLDR: we’ve built an open-source drop-in replacement for a postgres read-replica, powered by duckdb’s columnar compute engine. It’s very fast. And it looks like postgres. So, this started out as: let’s just connect Clickhouse to our postgres dbs and throw our analytics queries at it instead.…

- **Page:** https://magpie.gallery/i/mason-a-lightweight-postgres-read-replica-built-on-ncnn
- **Type:** Link to an idea elsewhere
- **Category:** AI & dev
- **Tags:** postgres, columnar, read-replica, open-source, analytics

## Source

Web · tagspace: Mason – A lightweight Postgres read-replica, built on columnar storage

- **Original:** https://news.ycombinator.com/item?id=50630294

> Hi HN! TLDR: we’ve built an open-source drop-in replacement for a postgres read-replica, powered by duckdb’s columnar compute engine. It’s very fast. And it looks like postgres. So, this started out as: let’s just connect Clickhouse to our postgres dbs and throw our analytics queries at it instead. That will speed everything up. But we quickly found that 1) Clickhouse comes with quite the learning curve (engine optimisation) to make it fast (we needed something we could easily drop in to any customer’s postgres scenario), and 2) we had underestimated how different clickhouse’s SQL syntax was to postgres. Don’t get me wrong: we love Clickhouse (it’s ridiculously fast if you know what queries to expect), it just didn’t work for our ad-hoc postgres workloads. So we went searching for alternatives that were 1) more plug-and-play and 2) looked a lot more like postgres. We dismissed a bunch based on desk research alone: - pg_mooncake (seems to have stalled since data bricks bought them) - pg_duckdb (seems to offer fast queries, or fresh data, but not both - we needed both) - materialize/risingwave/readyset (like Clickhouse, they require knowing the query shapes upfront - not ideal for ad-hoc workloads) - firebolt (license makes it challenging to offer to our customers) - redshift / alloydb / etc (we wanted something cloud-provider agnostic) And we shortlisted 3: - pg_clickhouse (Postgres extension that parses SQL in Postgres and pushes the work down to ClickHouse) - cedarDB (closed-source, Postgres-compatible analytical database) - duckdb (open-source, embedded columnar analytics engine with a Postgres-like SQL dialect) We needed to know how they would perform on real postgres queries, so we took a backlog of 5,410 (hand-written) queries (chosen because they had been slow to execute against postgres) from 159 real postgres databases. We then generated synthetic data (dynamically using the schemas from those 159 databases) to fill 159 local databases so we could run the ex

## Rules for reuse

- Build your own version: don't copy another product's code, look, icons, colours or copy.
- The original belongs to its author; Magpie only links to it.
- The original content's copyright belongs to its creator. Magpie doesn't download or re-upload it; we only show the link and the official preview.
