6 ms·
There's a gradual approach there, where you start out with a JSONB column, and then as each piece of the data structure stabilizes* you move it out of json fiel
by piaste 3y ago
There's a gradual approach there, where you start out with a JSONB column, and then as each piece of the data structure stabilizes* you move it out of json fields and into its own columns/tables.
* meaning, when there's enough code that depends on it that changing it would require some planning
- jadbox 3y agoThis is the way I build all my apps now. Eventually the jsonb field stores nothing as it all gets moved to defined fields.
- rav 3y agoAlternatively, keep it in the JSON/JSONB column until you need to search/filter/query on it, in which case you pull it out into a column.
- piaste 3y agoEven that may not be immediately necessary. I don't think SQLite has it yet, but Postgres can build partial indexes on JSONB fields. Though most of the time, in that situation, I would pull it out.