JSON v JSONB: A Dive into PostgreSQL

Friday, March 22, 2019 - Jerry Sievert

JSON, 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 a key and a value
  • a key is a string
  • a value can be a string, number, boolean, array, object or null

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.

[continue]