Re:Show HN: Pg_jsonschema – A Postgres extension for JSON va...
by edmundsauto on Thursday July 21, 2022 @07:06PM
(#32186356)
Ah gotcha, so the use case is when the frontend wants to send JSON and there is no backend dev around to munge things into a standard postgres schema in order to save it?
Honestly, it seems like a middleware layer would suffice in order to stick with more "standard" postgres features. (not to indict this feature, but simply because its more likely a maintainer would understand and have experience)
Re:Show HN: Pg_jsonschema – A Postgres extension for JSON va...
by gregplaysguitar on Friday July 22, 2022 @05:24AM
(#32190159)
There’s a lot of value in keeping data in the same format everywhere. Why “munge” it into some other format if there’s no actual need?
Developers sometimes really just want to dump the data as a JSON. For them this means not having to write a lot of boiler plate ORM or SQL templates, and shipping trivial features quickly.
Example, user UI preferences are a good candidate for something like this. You probably don't want to add a new column just to remember the status of checkbox, when the user last logged in.
As a DBA, you probably still want to define a schema for this data, so as to not cause unexpected web app crashes. It ensures the some level of data consistency without increasing the maintenance overhead.
Obviously you wouldn't use it for business critical data, in my opinion.