MeterStore

Documentation

MeterStore is a Rust library. It is not a database, not a service and not an EDM system: it stores metering’s types across two tiers and serves them through one SQL surface.

Read Getting started first, then Architecture — almost everything else follows from the tiering boundary.

If you are evaluating rather than integrating, the two pages that matter are Reproducibility and External engines: those carry the arguments that are hard to retrofit later.

Pages

  • Getting started Requirements, installation, and a store over both tiers in about thirty lines of Rust.
  • Architecture The tiering watermark, why the two tiers are disjoint by construction, how archival stays crash-safe, and what the design deliberately does not do.
  • Storage model The physical columns, the merge key that decides which reading supersedes which, identity versus attribute columns, and the constraints that stop a write producing a wrong number.
  • Writing readings Routed writes, the bulk path for steady-state ingest, idempotent redelivery, and knowing what a write displaced.
  • Querying SQL across both tiers, results that carry the boundary they were computed against, the typed series API, and the calendar functions that make daily sums correct.
  • Reproducibility Reproducing a past settlement: pinned Iceberg snapshots with an enforced version ceiling, and the transaction-time axis that covers the hot window too.
  • Completeness A missing interval is information, not an empty set. DST-aware gap detection as a first-class query.
  • Operations Scheduling archival, the system tables an operator opens during an incident, metrics worth alerting on, schema evolution, and the failure matrix.
  • The CLI meterstore init, check, create, status, archive, maintain, query, completeness and serve — the same library, without a program to write.
  • External engines Reading the history from Spark, Trino, DuckDB or PyIceberg with MeterStore out of the data path — and the version-resolution trap that silently double-counts if you skip one step.
  • Privacy and retention Why 15-minute consumption is personal data, why § 60 Abs. 6 MsbG is a deletion duty rather than a retention mandate, and how pseudonymisation satisfies it over an append-only lake.
  • Configuration The builder is the API and TOML is a front end over the same validated types, so a file and a hand-built configuration pass through identical checks.