Databases · Flashcard

What is the key difference between JSON and JSONB?

  • AJSON stores the exact text while JSONB stores a parsed binary form that is faster to query
  • BJSON is the standard type while JSONB is deprecated in favor of the newer jsonpath
  • CJSON allows nested objects while JSONB is limited to flat key-value documents
  • DJSON validates the document while JSONB accepts any text without checking it

Why this is the answer

JSON keeps the input text verbatim (fast to write, slow to query); JSONB parses into a binary format supporting indexing and containment operators — the usual default choice. JSONB is anything but deprecated, both nest arbitrarily, and both validate — JSONB additionally normalizes duplicates and whitespace.

Official docs
Study in Gnoseed →