The difference is the storage format, which is important for a SQL database since you define it in the schema. Also the performance characteristics are different.
Re:JSONB Has Landed in SQLite
by The_Colonel on Wednesday December 06, 2023 @04:35AM
(#38541995)
As someone mentioned below, the order of keys is undefined in JSON spec, but applications may rely on it anyway, and thus conversion to JSONB may lead to breakage.
There are some other minor advantages of having exact representation of the original - e.g. hashing, signatures, equality comparison is much simpler on the JSON string (you need a strict key order, which is again undefined by the spec, but happens in the real world anyway).
`json_` functions return json, `jsonb_` functions return jsonb. Both take either as input.
If you're modifying something "in-place" then `jsonb_` functions would be better since they avoid conversion.
It seems that the JSON type is even able to contain JSONB.