Metering time series at settlement scale,
in an open format.
PostgreSQL holds the recent interval window at low latency. Apache Iceberg holds the history at analytical scale. One explicit timestamp separates them, and one SQL statement spans both.
MeterInterval.from ─────────────────────────────────────▶
│◀──── Iceberg (cold, settled) ────▶│
│◀── Postgres (hot) ──▶│
epoch tiering_watermark now
Settlement ingestion
At 15-minute resolution, 100,000 channels produce 9.6 million readings a day. MeterStore archives complete PostgreSQL partitions to Iceberg and records the new watermark in the same snapshot as the data.
A settlement writer can reject batches that cross the watermark and require replays to match quality, span, unit, or a declared price. An approved correction names the version of every slot it replaces and lands whole or not at all, so two authors cannot both replace the same version. Configure a settlement writer.
One statement, both tiers
let result = store.query(r#"
SELECT meter_local_day("from") AS day, SUM(value) AS kwh
FROM readings
WHERE malo_id = '41373559241'
AND "from" >= '2025-01-01' AND "from" < '2026-01-01'
GROUP BY 1 ORDER BY 1
"#).await?;
// Every result carries the boundary it was computed against.
result.watermark(); // where cold ended and hot began
result.tiers_scanned(); // [Cold, Hot]
result.touched_hot_tier(); // whether the answer is only valid for now
The planner splits the range at the watermark. Use meter_local_day for local
calendar days and meter_balancing_day for commodity-specific settlement days.
Reproduce a settlement
Pin an Iceberg snapshot and version ceiling for an archived settlement. To read what was known at an instant across both tiers, use a transaction-time cutoff. Reproducible reads.
DuckDB and PyIceberg can read the archived Parquet files through the Iceberg catalog. The logical readings view resolves corrections by version. Query from an external engine.