Skip to Content
Analytics StoreConfiguration Reference

Configuration Reference

Properties

PropertyDefaultDescription
yaci.store.analytics.enabledfalseEnable analytics store
yaci.store.analytics.export-path./data/analyticsOutput directory for exported files
yaci.store.analytics.finalization-lag-days2Days to lag behind tip (ensures immutability)
yaci.store.analytics.enabled-tables(empty = all)Comma-separated list of tables to export
yaci.store.analytics.admin.enabledfalseEnable admin REST API
yaci.store.analytics.storage.typeducklakeStorage format: ducklake or parquet
yaci.store.analytics.state-management.stale-timeout-minutes60Timeout before stuck exports are recovered
yaci.store.analytics.continuous-sync.buffer-days2Buffer days for continuous sync
yaci.store.analytics.continuous-sync.sync-check-interval-minutes15Gap detection interval when fully synced
yaci.store.analytics.continuous-sync.catch-up-interval-minutes1Gap detection interval when catching up
yaci.store.analytics.continuous-sync.export-after-synctrueDefer exports until the sync reaches chain tip. Set false to export during the sync
yaci.store.analytics.parquet-export.codecZSTDCompression codec
yaci.store.analytics.parquet-export.compression-level3ZSTD compression level (1-22)
yaci.store.analytics.parquet-export.row-group-size-1Parquet row group size (-1 = DuckDB default ~122,880 rows)
yaci.store.analytics.ducklake.catalog-typepostgresqlDuckLake catalog: postgresql or duckdb
yaci.store.analytics.ducklake.catalog-url(main datasource)PostgreSQL URL for catalog
yaci.store.analytics.ducklake.catalog-username(main datasource)PostgreSQL catalog username
yaci.store.analytics.ducklake.catalog-password(main datasource)PostgreSQL catalog password
yaci.store.analytics.ducklake.catalog-path./data/analytics/ducklake.catalog.dbDuckDB catalog file path
yaci.store.analytics.duckdb.memory-limit(empty = DuckDB default)DuckDB buffer manager memory limit (e.g., 1GB, 512MB)
yaci.store.analytics.ducklake.export.codecZSTDCompression codec for DuckLake Parquet files
yaci.store.analytics.ducklake.export.compression-level3ZSTD compression level (1-22) for DuckLake exports
yaci.store.analytics.ducklake.export.row-group-size-1Row group size for DuckLake Parquet files (-1 = DuckDB default)
yaci.store.analytics.exporter.{name}.enabledtruePer-exporter enable/disable (e.g., exporter.reward.enabled=false)

Known Caveats

Workspace-sensitive catalog path (DuckLake)

DuckLake stores DATA_PATH in catalog metadata. If you use a relative export-path (e.g., ./data/analytics), the Parquet file paths in the catalog are relative to the working directory where yaci-store was started.

When querying with DuckDB CLI or Python, you must start from the same working directory as the application. Otherwise, DuckLake will fail to locate the Parquet files.

Recommendation: Use absolute paths in production:

yaci.store.analytics.export-path=/var/lib/yaci-store/analytics

DuckDB memory usage in JVM

If not configured, DuckDB uses its default (80% of system RAM). It is recommended to set this explicitly in production and container environments to prevent OOM kills.

DuckDB defaults to using 80% of system physical RAM for its buffer manager. Since DuckDB runs inside the JVM process, this can cause memory contention — JVM heap + DuckDB buffer may together exceed available system RAM, leading to OOM kills (especially in containers/Kubernetes).

To limit DuckDB memory usage:

# Limit DuckDB buffer manager to 1GB per connection yaci.store.analytics.duckdb.memory-limit=1GB

Note: With writer pool (1 connection) + reader pool (N connections), total potential DuckDB memory is memory_limit * (1 + N). Some DuckDB aggregate functions may also allocate memory outside the buffer manager, so actual usage can slightly exceed the configured limit.

DuckLake requires public schema in PostgreSQL

DuckLake stores its metadata tables in the public schema. The application automatically creates this schema if it doesn’t exist. If your PostgreSQL instance restricts schema creation, ensure public exists before enabling DuckLake.

Admin API

The admin API provides manual control over exports when enabled (yaci.store.analytics.admin.enabled=true).

MethodEndpointDescription
GET/api/v1/analytics/admin/tablesList all registered exporters
GET/api/v1/analytics/admin/statusCurrent sync status
GET/api/v1/analytics/admin/statistics/{table}Export statistics for a table
POST/api/v1/analytics/admin/export/date/{date}Export all daily tables for a date
POST/api/v1/analytics/admin/export/table/{table}/date/{date}Export specific table for a date
POST/api/v1/analytics/admin/export/table/{table}/epoch/{epoch}Export specific table for an epoch
POST/api/v1/analytics/admin/export/table/{table}/rangeBackfill date range
POST/api/v1/analytics/admin/export/table/{table}/epoch-rangeBackfill epoch range
POST/api/v1/analytics/admin/sync/triggerTrigger immediate gap sync
DELETE/api/v1/analytics/admin/state/{table}/{partition}Reset export state
DELETE/api/v1/analytics/admin/state/{table}/rangeReset date range state

Example: Export and query a specific date

# Trigger export for a specific date curl -X POST http://localhost:8080/api/v1/analytics/admin/export/date/2024-01-15 # Query the exported data duckdb -c "SELECT COUNT(*) FROM read_parquet('./data/analytics/transaction/date=2024-01-15/*.parquet');"
Last updated on