I prefer Postgres for it's JSONB storage and indexing, basically allowing it to take any JSON data as a field and quickly look things up. I see it as having benefits of NoSQL databases while keeping it relational.
They get inserted like strings. But the column type has a bunch of special features, like you can query into the json for your select or check a value in the where.
is this not implemented widely in the industry? I dont have that much professional experience but I haven't seen this one implemented anywhere in the production
Not likely if your database has been around for more than a couple years.
Even Microsoft SQL Server supports json columns now though, so it's sort of picking up.
When you use that type, you trade off most of the benefits of relational data. So it is only really great for some use cases. But for those use cases, it is awesome!
It's also a nice way to just store blobs of data in a database rather than a file system or cloud storage. You don't lose out on the relational features since you wouldn't have them with the alternatives anyways.
I used it for quite a few years there. Super, super useful. Happy to go there again but where I'm at now were stuck with mongo. Horrid system by comparison.
JSONB is a column type. Possible use case: you have an object that has another object as a property. Instead of creating a new table and having a foreign key, just serialize the property and store it in a JSONB column
60
u/tomma5o Sep 24 '20 edited Sep 24 '20
Sorry FE dev here, why you guys prefer postgreSQL over mySQL?