Skip to main content
Version: 0.2

Architecture

The core of pg_mooncake is Moonlink: a rust library which enables sub-second replication of Postgres tables into Iceberg. Moonlink is embedded as a background worker in Postgres.

When you create a columnstore copy of your Postgres tables, Moonlink:

  1. Performs initial full table copy
  2. Maintains sync via Postgres logical replication
  3. Manages columnstore metadata and exposes tables to embedded DuckDB

Architecture Diagram v0.2

Write Path​

All inserts, updates, and deletes on regular Postgres rowstore tables are automatically replicated to the columnstore via Moonlink.

  • Direct writes to columnstore tables are not supported in v0.2 (unlike v0.1)
  • All data modifications (INSERT/UPDATE/DELETE) must be performed on the rowstore table. Changes are automatically replicated to columnstore.
  • Roadmap: Retain complete history in columnstore while periodically truncating rowstore tables

Read Path​

All reads on columnstore tables are executed through the embedded DuckDB in Postgres:

  • Read-committed isolation level
  • Consistent reads with sub-second freshness

Query columnstore tables like regular Postgres tables:

  • Join across columnstore and regular tables
  • Use any Postgres-compatible BI tool or ORM