Is storing flags/config as a single jsonb row in a postgres table a reasonable thing to do
I know there are better ways to implement this, but this one was the simplest to write a ui to edit them
I'm just displaying formatted json in a monacco editor and parsing and storing it in that column.
Aside from potential performance issues, which I don't think will affect us for a good while, are there any other downsides to this approach?
5 Replies
It is something that will only be accessible by developers and the non technical founder, obviously,
The problem is when fetching/duplication
With a little bit of sql should be easy to replicate that
Using jsonb is more tricky for it, even more if you are using Monaco for it
hmm, im doing this to prevent it from happening, if what you mean is duplicate rows for the flags
this is the only place where it can get set, and this isn't a problem because its used rarely and there is only one column
i mean, using separate db rows for everything would likely be cleaner
but the issue is the ui to edit them
Groups of users will have duplicated json values, like, full jsonb structures
But if storing json works for you, go for it