Welcome to pg_mooncake
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:
- Columnar storage (Apache Iceberg, via Moonlink)
- 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.
- Complex ETL pipelines and data modeling, often involving Debezium and Kafka.
- Maintaining consistency between transactional and analytical queries. ClickHouse often struggles with concurrent updates/deletes and stores multiple copies of data.
- 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
- Zero-ETL sync from existing Postgres tables: create a columnstore mirror of your Postgres tables.
- Transaction-safe OLTP + OLAP: reads from pg_mooncake reflect the latest transactions.
- Just Postgres to query/manage: the same infrastructure used to run your OLTP.
- 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
- Join our community
- ⭐ Star pg_mooncake on GitHub
- Check out Moonlink. The first real-time Postgres-to-Iceberg CDC.
- Follow us on X/Twitter