I'm building a feature where I have to get/save a config (something like a json structure) into db. So this postgresql jsonb data type came into my mind. Because this config doesn't have to be related to other table. coming from a nosql background, is my use case for jsonb correct? (I don't want to abuse this feature or use it wrongly)
Is this the right thing to do? Just to double confirm with experienced dev here before I start implementing it.
That seems like a use case for jsonb
or json
.
These data types are useful to store information in the database that is of use for the application, but is not used much inside the database.
If you plan to use values from the JSON in queries, for example to join with other tables or to filter in WHERE
clauses, you should consider storing these values as normal table columns (perhaps keeping the rest in a JSON).
While PostgreSQL has support for processing JSON inside the database, queries that make use of that a lot tend to become complicated and slow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With