Real-Time Operational Analytics (HTAP)
Speed up slow analytical queries on PostgreSQL tables by routing reads to a real-time USING mooncake columnstore mirror while keeping your OLTP write path unchanged.
If you are running slow analytical queries (dashboards, customer-facing metrics, multi-table aggregations) on PostgreSQL tables, pg_mooncake gives you a straightforward route to accelerate them:
- Keep your application write path 100% unchanged.
- Create a real-time columnstore mirror with
CALL mooncake.create_table(dst, src). - Route analytical
SELECTqueries to the columnstore mirror table.
Key Advantages
- Schema changes supported:
ALTER TABLE ... ADD COLUMNandDROP COLUMNon the source table automatically sync to the columnstore mirror. - Fast
UPDATEandDELETEhandling:moonlinkuses in-memory Apache Arrow buffers and Roaring Bitmap deletion vectors, handling high-frequency OLTP updates and deletes far more efficiently than traditional Parquet/Iceberg writers. - Zero-ETL: No Debezium, Kafka, or Flink clusters to operate—
pg_mooncakeuses PostgreSQL’s built-in logical replication. - Transactional consistency: Analytical queries wait for the current PostgreSQL WAL LSN barrier before scanning, guaranteeing a consistent view of committed data.
Implementation Pattern: Write to Rowstore, Read from Columnstore
Manual Query Routing
Explicit Table Routing
pg_mooncake does not automatically rewrite queries targeting orders to target orders_analytics. You choose which table to query based on your workload:
This explicit separation gives you predictable performance: transactional operations stay fast on the B-tree-indexed heap table, while analytical scans leverage DuckDB 2.0’s vectorized execution over columnar storage.