Volver al ranking

Mooncake-Labs/pg_mooncake

Rustmooncake.dev

Real-time analytics on Postgres tables

analyticscolumnstoredelta-lakeiceberglakehouseparquetpostgresql
Crecimiento de estrellas
Estrellas
2k
Forks
71
Crecimiento semanal
Issues
14
5001k1.5k
oct 2024may 2025dic 2025jul 2026
Artefactoscrates.iocargo add pg_mooncake
README

pg_mooncake 🥮

Real-time analytics on Postgres tables

Overview

pg_mooncake is a Postgres extension that creates a columnstore mirror of your Postgres tables in Iceberg, enabling fast analytics queries with sub-second freshness:

  • Real-time ingestion powered by moonlink for streaming and batched INSERT/UPDATE/DELETE.
  • Fast analytics accelerated by DuckDB, ranking top 10 on ClickBench.
  • Postgres-native allowing you to query a columnstore table just like a regular Postgres table.
  • Iceberg-native making your data readily accessible by other query engines.

Installation

Option 1: Docker

For new users, we recommend using the Docker image to get started quickly:

docker run --name mooncake --rm -e POSTGRES_PASSWORD=password mooncakelabs/pg_mooncake

This will start Postgres with pg_mooncake preinstalled. You can then connect to it using psql with the default user postgres:

docker exec -it mooncake psql -U postgres

Option 2: From Source

To build pg_mooncake, first install Rust, pgrx, and the build tools for DuckDB.

Then, clone the repository:

git clone --recurse-submodules https://github.com/Mooncake-Labs/pg_mooncake.git

To build and install for Postgres versions 14-18, run:

cargo pgrx init --pg18=$(which pg_config)   # Replace with your Postgres version
make pg_duckdb                              # Skip if pg_duckdb is already installed
make install PG_VERSION=pg18

Finally, add pg_mooncake to shared_preload_libraries in your postgresql.conf file and enable logical replication:

duckdb.allow_community_extensions = true
shared_preload_libraries = 'pg_duckdb,pg_mooncake'
wal_level = logical

For a complete walkthrough, refer to our Dockerfile.

Quick Start

First, create the pg_mooncake extension:

CREATE EXTENSION pg_mooncake CASCADE;

Next, create a regular Postgres table trades:

CREATE TABLE trades(
  id bigint PRIMARY KEY,
  symbol text,
  time timestamp,
  price real
);

Then, create a columnstore mirror trades_iceberg that stays in sync with trades:

CALL mooncake.create_table('trades_iceberg', 'trades');

Now, insert some data into trades:

INSERT INTO trades VALUES
  (1,  'AMD', '2024-06-05 10:00:00', 119),
  (2, 'AMZN', '2024-06-05 10:05:00', 207),
  (3, 'AAPL', '2024-06-05 10:10:00', 203),
  (4, 'AMZN', '2024-06-05 10:15:00', 210);

Finally, query trades_iceberg to see that it reflects the up-to-date state of trades:

SELECT avg(price) FROM trades_iceberg WHERE symbol = 'AMZN';

Contributing

pg_mooncake is an open-source project maintained by Mooncake Labs and licensed under the MIT License. We'd love your help to make it even better! Join our Slack, participate in discussions, open issues to report bugs or suggest features, contribute code and documentation, or help us improve the project in any way. All contributions are welcome! 🥮

Repositorios relacionados
grafana/grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.

TypeScriptnpmGNU Affero General Public License v3.0grafanamonitoring
grafana.com
75.7k14.3k
apache/superset

Apache Superset is a Data Visualization and Data Exploration Platform

PythonPyPIApache License 2.0supersetapache
superset.apache.org
73.9k17.9k
ClickHouse/ClickHouse

ClickHouse® is a real-time analytics database management system

C++Apache License 2.0dbmsolap
clickhouse.com
48.8k8.7k
metabase/metabase

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

ClojureOtheranalyticsbusinessintelligence
metabase.com
48.3k6.7k
duckdb/duckdb

DuckDB is an analytical in-process SQL database management system

C++MIT Licensesqldatabase
duckdb.org
39.6k3.5k
umami-software/umami

Umami is a modern, privacy-focused analytics platform. An open-source alternative to Google Analytics, Mixpanel and Amplitude.

TypeScriptnpmMIT Licenseanalyticscharts
umami.is
37.8k7.6k
PostHog/posthog

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

PythonPyPIOtheranalyticspython
posthog.com
37.1k3.1k
langfuse/langfuse

🪢 Open source AI engineering platform: LLM evals, observability, metrics, prompt management, playground, datasets. Integrates with OpenTelemetry, LangChain, OpenAI SDK, LiteLLM, and more. 🍊YC W23

TypeScriptnpmOtheranalyticsllm
langfuse.com
31.5k3.3k
academic/awesome-datascience

:memo: An awesome Data Science repository to learn and apply for real world problems.

MIT Licensedata-sciencemachine-learning
29.7k6.6k
getredash/redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.

PythonPyPIBSD 2-Clause "Simplified" Licenseredashpython
redash.io
28.7k4.6k
plausible/analytics

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

ElixirGNU Affero General Public License v3.0analyticsprivacy
plausible.io
27.9k1.7k
timescale/timescaledb

A time-series database for high-performance real-time analytics packaged as a Postgres extension

COthertime-series-databasepostgresql
tigerdata.com
23.1k1.1k