We recently migrated a large jsonb column to json because, iirc, both the write and the read speeds were much better when there was no (de)serialization involved.
My current understanding is that json is faster and bigger than jsonb.
> My current understanding is that json is faster and bigger than jsonb.
FYI, it's the other way around. When you use the json type, Postgres validates it and stores the raw string. Operations on json are very slow. Whenever you extract a field from a json column, Postgres has to parse the full json.
On the other hand, jsonb is stored in a custom binary format. This makes operations a lot faster as Postgres does not have to parse the full json. There's also some other advantages such as jsonb stores the keys in sorted order making it possible to do a binary search to find a specific key in a lookup.
There are two primary downsides of jsonb. First, it doesn't preserve whitespace. This can be a problem for some use cases. Second, since there is a lot of metadata in jsonb, jsonb is larger. Postgres stores information like the offsets of every key and value.
My current understanding is that json is faster and bigger than jsonb.