0003 — Buffered vs durable metering, and the period seam
View Source- Status: Accepted
- Date: 2026-07-11
Context
Some usage (dashboards, soft quotas) tolerates a tiny loss window; billing-grade usage does not. Billing periods differ between the free core (calendar month) and Pro (subscription-aligned).
Decision
- Metering mode is per-feature:
:buffered(default — ETS-first, flushed on an interval) or:durable(also writes an event row synchronously ontrack). AuroraMeter.Period.current/2resolves the active window through a configurable:period_sourceseam, defaulting toAuroraMeter.Period.Calendar(monthly, UTC). Pro sets:period_sourceto subscription-aligned bounds.
Consequences
- Phase 3 MUST ship the
:period_sourceseam even though only the calendar implementation exists at that point, so Pro can override it without editing core call sites. - Absolute-value upserts make the flusher idempotent and reset-free: a new
period_startin the counter key starts a fresh window automatically; old rows are retained as history.