Decision needed
How should we structure the data model so ERCOT's 24 fields can coexist with future ISOs (CAISO, MISO, NYISO, ISO-NE, PJM, CENACE) that have wildly different field sets?
Options
A. Wide single table with NULLable ISO-specific columns
- One
service_points table holds the union of all ISO fields
- Pros: simple queries; one schema
- Cons: column count explodes; semantically unclear (which fields apply to which ISO?); migrations on millions of rows
B. Universal columns + JSONB iso_attributes
service_points has only universal columns (id, iso, address, city, state, zip, status, is_active, search_vector, timestamps); ERCOT-specific fields live in iso_attributes JSONB
- Pros: schema stable; cheap to add an ISO; queryable via JSONB operators
- Cons: typeless; harder to index specific fields; query verbosity
C. Universal columns + per-ISO sidecar tables
service_points (universal) + service_points_ercot_attrs (FK + ERCOT columns) + service_points_caiso_attrs, etc.
- Pros: typed; indexable; clear ownership per ISO
- Cons: more migrations; joins for full-record queries
Required output
A short ADR at docs/adr/0001-multi-iso-schema-strategy.md documenting:
Why now
This decision needs to land before more v0.2.0 schema work continues, otherwise issues like #16 and #20 risk being done one way and redone in v0.4.0.
Blocks
Context
See docs/multi-iso-plan.md for the broader multi-ISO architectural plan.
Decision needed
How should we structure the data model so ERCOT's 24 fields can coexist with future ISOs (CAISO, MISO, NYISO, ISO-NE, PJM, CENACE) that have wildly different field sets?
Options
A. Wide single table with NULLable ISO-specific columns
service_pointstable holds the union of all ISO fieldsB. Universal columns + JSONB
iso_attributesservice_pointshas only universal columns (id, iso, address, city, state, zip, status, is_active, search_vector, timestamps); ERCOT-specific fields live iniso_attributes JSONBC. Universal columns + per-ISO sidecar tables
service_points(universal) +service_points_ercot_attrs(FK + ERCOT columns) +service_points_caiso_attrs, etc.Required output
A short ADR at
docs/adr/0001-multi-iso-schema-strategy.mddocumenting:esiidstableWhy now
This decision needs to land before more v0.2.0 schema work continues, otherwise issues like #16 and #20 risk being done one way and redone in v0.4.0.
Blocks
esiidsdirectly)Context
See
docs/multi-iso-plan.mdfor the broader multi-ISO architectural plan.