News for hackers. Stuff that matters.
Re:JSONB Has Landed in SQLite by buzziebee on Wednesday December 06, 2023 @03:51AM (#38541749)
Yeah migrations are the biggest issue for me. I really don't like not knowing what the actual shape of the document will be. Missing transactions, and not great relationship performance makes modelling some systems more hassle than it's worth.

I gave it a good go to use mongo and firestore for a few projects, but after a year or two of experimenting I'll be sticking to SQL based DBs unless there are super clear and obvious benefits to using a document based model.

Re:JSONB Has Landed in SQLite by piaste on Wednesday December 06, 2023 @06:07AM (#38542462)
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

Re:JSONB Has Landed in SQLite by jadbox on Wednesday December 06, 2023 @07:56AM (#38543208)
This is the way I build all my apps now. Eventually the jsonb field stores nothing as it all gets moved to defined fields.
Re:JSONB Has Landed in SQLite by rav on Wednesday December 06, 2023 @10:03AM (#38544723)
Alternatively, 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.
Re:JSONB Has Landed in SQLite by piaste on Wednesday December 06, 2023 @10:34AM (#38545197)
Even 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.