Skip to main content
Version: 0.2

Welcome to pg_mooncake

Preview

pg_mooncake v0.2 is in preview. Expect frequent updates. Join our community for the latest.

pg_mooncake is a ClickHouse alternative for real-time analytics built on Postgres. It turns Postgres into a real-time analytics database by adding:

  1. Columnar storage (Apache Iceberg, via Moonlink)
  2. Vectorized execution with DuckDB (via pg_duckdb).

Fast analytics queries require both columnar storage & vectorized execution, and previous Postgres analytics solutions only solved half the problem.

                  *** ### ### ***              *** ### ### ***                  
*## ##* *## ##*
*## storage #*## compute ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## timescale *## pg_mooncake ##* pg_duckdb ##*
*## citus *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*## *## ##* ##*
*# *# ##* ##*
*## #*## ##*
*## ##* *## ##*
*** ### ### *** *** ### ### ***

pg_mooncake is ranked among the fastest analytics databases on ClickBench and is built entirely as a Postgres extension.

Read more about Architecture. It's also helpful to become familiar with Moonlink, a rust library for ingesting + managing data into Apache Iceberg.

The Problem

To run fast analytics queries on Postgres tables, developers typically replicate data into specialized analytics databases like ClickHouse, which is annoying.

  1. Complex ETL pipelines and data modeling, often involving Debezium and Kafka.
  2. Maintaining consistency between transactional and analytical queries. ClickHouse often struggles with concurrent updates/deletes and stores multiple copies of data.
  3. Managing a new client and figuring out joins between them.

It takes months of testing and introducing new infrastructure, and it's even harder to maintain.

pg_mooncake solves this cycle—with the familiarity of Postgres—and a dead-simple sync to a columnstore.

Why You'll Love pg_mooncake

  1. Zero-ETL sync from existing Postgres tables: create a columnstore mirror of your Postgres tables.
  2. Transaction-safe OLTP + OLAP: reads from pg_mooncake reflect the latest transactions.
  3. Just Postgres to query/manage: the same infrastructure used to run your OLTP.
  4. Data stored in Object store in Open Formats: data stored in S3 as Parquet Files + Metadata. Move to the open, interoperable data stack.

Get Started