Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
saving it sometimes is fine. like: when you _have_ hugely varying structures you have to store, and know you _never ever ever ever_ have to query any of the properties; if the data could just as well be stored as BLOB. but other than that? terrible.
-
C0D4669013yGuilty, but that json isn't queried directly,
-> that grinds my gears <-
why normalise a chunk of data that doesn't serve a purpose being normalised? -
Saving serialized documents in a relational database isn't bad per se.
You can additionally store parts of the document in other columns or tables to make them available to queries.
The worst case is that your relational database becomes a key-value store supporting SQL... -
C0D4669013y@vane
I have it for things like product dimensions as an example.
Purely presentational and only used to calculate freight, this data has no need to be queries directly, no one's going to search for a 10cm2 box.
So that data sits on a products record and is extracted as needed as there's only 2 places in the entire checkout that needs to know this, a product detail page and when we calculate freight with it.
Setting up another table to
Normalise it is just going to be a waste of a a data set and additional queries that no one needs or wants to bother with.
There's very limited uses I would have json in a db though. -
vane110523yyeah I understood, I don’t deny that you can just store json inside json data type, on the other side I have to move json columns from postgres to mysql that someone decided to query and that’s pure hell
Related Rants
saving and querying json in relational database
rant
database