JSON v JSONB: A Dive into PostgreSQL
Friday, March 22, 2019JSON, or JavaScript Object Notation, is a lightweight data interchange format that is easy for both computers and humans to deal with. The rules are pretty simple:
- a JSON document is an
object
- an
object
consists of akey
and avalue
- a
key
is astring
- a
value
can be astring
,number
,boolean
,array
,object
ornull
So, when dealing with data, JSON has become fairly popular: it's the default document storage type for databases like CouchDB and MongoDB (though MongoDB technically uses a JSON-like format), and available in PostgreSQL as the JSON and JSONB data types.