Build an analytics replica in minutes
# spicepod.yamldatasets: - from: postgres:public.orders name: orders params: pg_host: ${secrets:PG_HOST} pg_db: shop pg_user: ${secrets:PG_USER} pg_pass: ${secrets:PG_PASS} acceleration: enabled: true engine: cayenne # Columnar storage for analytical queries mode: file refresh_mode: changes # Stream every change from the WAL primary_key: id on_conflict: id: upsertsql> -- orders and revenue by hour, on the replica SELECT date_trunc('hour', created_at) AS hour, count(*) AS orders, sum(total) AS revenue FROM orders WHERE created_at > now() - INTERVAL '1 day' GROUP BY 1 ORDER BY 1;# example output2026-10-29 14:00 412 38120.502026-10-29 15:00 398 36904.25Connect your operational database
In
spicepod.yaml, add a dataset for each table to replicate. Setrefresh_modetochanges, a primary key, and anon_conflictupsert rule.Run Spice
Start Spice locally with
spice run, or deploy it as a sidecar, in your cluster, or on Spice Cloud.Query the replica
Run analytical queries from agents, BI tools, or your own apps. They run on the replica, not on your production database.

