• RonSijm@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 day 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)