Decide: which result sections to normalize into tables vs versioned JSON output #18
Labels
No labels
bug
decision
docs
enhancement
integration
ops
security
tech-debt
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/BatteryStorageCalculator#18
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Open Question carried over from
docs/roadmap.md.Currently the whole calculation output is a single JSON blob. That has already caused real problems: JSONB parameter bugs and a 344KB column being loaded on every status poll, both of which required targeted fixes.
Normalizing the sections that are queried or compared across homes/time - projections, quote comparison results - would avoid unpacking the blob to answer simple questions. Sections only ever read whole can stay JSON.
Related to the quote document storage work in v1.2.0, which is the same normalization pressure applied to inputs rather than outputs.
Decision (Ryan, 2026-07-17): keep the calculation output as a versioned JSON blob; normalize into tables only the sections that get queried across homes or time — concretely, quote comparison results and projection summaries — and only when #10 (quote persistence) starts. Sections that are only ever read whole stay JSON.
This keeps the blob as the single source for whole-result reads (the 344KB-column and polling lessons already produced meta/output split + ETag handling), while giving the cross-cutting queries real columns when the first feature actually needs them.
Closing as decided; the normalization work itself lands with #10.