ivy_mooncake Technical Design
ivy_mooncake adapts pg_mooncake to IvorySQL. It maintains Apache Iceberg columnstore mirrors alongside transactional row-store tables. Analytical queries use DuckDB through ivy_duckdb.
1. Data path
Application writes -> IvorySQL row-store table -> logical WAL replication
-> ivy_moonlink -> Iceberg columnstore mirror
Analytics queries -> pg_mooncake / ivy_duckdb -> Iceberg columnstore mirror
Use mooncake.create_table to create a mirror for a source table. Ingestion copies existing data and then applies committed source changes through logical replication. Applications continue to insert, update, and delete rows in the source table while analytical SQL reads the mirror. DuckDB reads the mirror through ivy_duckdb_mooncake. See the ivy_duckdb technical design for how queries reach DuckDB.
2. Data visibility
A source commit, change ingestion, visibility to a mirror query, and persistence to Iceberg are distinct stages. Account for replication lag when querying a change that has just committed. When creating a mirror for the first time, check the initial data and then verify that later changes appear. External query engines can read data published as Iceberg snapshots when they use compatible catalog and storage settings.
3. Storage and recovery
Row-store tables, WAL retained for logical replication, and mirrors all consume storage. Monitor source WAL retention, replication progress, and space available to the mirror. If ingestion stops, restore the ivy_moonlink worker and storage access, then verify that replication and mirror updates resume. See the IvorySQL 6.0 release notes for session reconnection after worker restarts and Iceberg-based recovery support.
For setup and verification, see the ivy_mooncake user guide. Implementation details are available in the ivy_mooncake and ivy_moonlink repositories.