this post was submitted on 06 Nov 2024
10 points (100.0% liked)

PostgreSQL

677 readers
1 users here now

The world's most advanced open source relational database

Project
Events
Podcasts
Related Fediverse communities

founded 2 years ago
MODERATORS
 

What are your experiences with @postgresql jsonb columns as document store?

Is it easy to use from a Spring App? How fast is it? What are its limitations?

#postgresql #json #databases

you are viewing a single comment's thread
view the rest of the comments
[–] RonSijm 4 points 1 month ago

I haven't used json(b) in a Spring app, so I can't say much about that.

Json vs Jsonb depends on the use-case. Inserting json is faster than inserting Jsonb. Reading json (based on searching for specific json properties) Jsonb is faster, because Jsonb is parsed into a more optimized tree.

From my experience, I don't really like doing selects based on json properties. If I know I'll be selecting a certain property, I usually add an additional column next to the json with the data, and insert that property there (At least in c#/dotnet, with EF) The frameworks don't have that much support for selecting within json (you can do it, it's just a lot more natively supported to use proper columns)