ivy_mooncake Use Cases and User Guide
Use ivy_mooncake for workloads such as trading dashboards and operational reports that continuously query recent business data. Applications write to IvorySQL row-store tables and reports query the corresponding Iceberg columnstore mirrors. Plan storage for the mirrors and monitor replication progress.
1. Set up the extensions and logical replication
Choose an ivy_mooncake build that matches your IvorySQL version and install its ivy_duckdb dependency. Follow the instructions for the same release to configure ivy_moonlink and mirror storage, whether building from source or deploying an image.
In postgresql.conf, add pg_duckdb and pg_mooncake to shared_preload_libraries, keep the existing entries, and set wal_level to logical. If you installed from source and your release loads the DuckDB community Mooncake extension, set duckdb.allow_community_extensions to true as described in the project’s installation guide. Restart the instance and create the extension in the target database.
CREATE EXTENSION IF NOT EXISTS pg_mooncake CASCADE;
2. Create a mirror and verify incremental replication
Follow the tested PG-mode and Oracle-mode examples in the quick start. Both insert data into a source table with a primary key and call mooncake.create_table to create the Iceberg columnstore mirror. Query the mirror to check the initial rows, then update one source row and query the mirror again.
The rows value stays at 2 in both modes. The total changes from 30 to 35 in PG mode and from 30.50 to 35.50 in Oracle mode. If your client has autocommit disabled, commit the source update before waiting for the mirror to apply it.
3. Check replication
A mirror can take time to reflect a commit on the source. If the result remains stale, confirm the source commit and check the ivy_moonlink worker, the logical replication slot used for ingestion, and mirror storage.
SELECT slot_name, active, restart_lsn, confirmed_flush_lsn
FROM pg_replication_slots
WHERE slot_type = 'logical';
Identify the relevant slot in the result. Its activity and advancing replication positions help diagnose ingestion. Verify what users can actually see in the mirror by querying for a known change. See the ivy_mooncake technical design for the data path and recovery behavior.