Jsonb
JSONB is PostgreSQL's binary JSON data type, storing JSON values in decomposed form for efficient processing and indexing.
Just Use Postgres!
jsonb is PostgreSQL's binary JSON data type that stores JSON values in a decomposed form for efficient processing and indexing.
- How it is used
- Deploys JSON storage for database-level field queries, nested filtering, manipulation, and indexing in PostgreSQL applications.
- How deep it goes
- Explains binary storage, trade-offs, operators, array traversal, updates, and GIN indexing, but defers detailed index implementations.
- Examples
- Uses pizza orders, nested toppings arrays, sausage-key searches, and gluten-free containment reports.
- What you can do after
- Apply it via PostgreSQL SQL to store, inspect, filter, update, remove, and index JSON structures.
PostgreSQL Mistakes and How to Avoid Them
JSONB is PostgreSQL's binary JSON data type for storing structured data in a decomposed representation that supports indexing and efficient processing.
- How it is used
- Supports indexable storage for genuinely variable or sparse structured attributes, especially during data ingestion.
- How deep it goes
- Explains the relational JSON anti-pattern through document tables and extraction-heavy join queries, without detailing JSONB storage internals.
- Examples
- Uses JSONB customer accounts and sales documents joined through extracted account IDs and filtered through casts and nested fields.
- What you can do after
- Evaluate/understand when flexible JSONB storage fits sparse ingestion and when relational modeling avoids complex retrieval.
Read how PostgreSQL Mistakes and How to Avoid Them explains jsonb →
Designing AI Systems
JSONB is PostgreSQL's binary JSON data type for storing structured JSON values with database indexing and querying support.
- How it is used
- Stores nested tool-call structures within relational message records while preserving future querying and filtering options.
- How deep it goes
- Explains the JSONB-versus-JSON performance trade-off and schema placement, but stops short of showing query syntax or index definitions.
- Examples
- Uses a messages table whose tool_calls column stores IDs, function names, and arguments as nested JSONB data.
- What you can do after
- Designs a PostgreSQL message schema that stores searchable nested tool-call data without additional tables.
Also covered in
- Crack Any Codebase with AIIn early access (MEAP)
What to know first
- GIN indexA GIN index is a PostgreSQL generalized inverted index that maps components of composite values to rows containing them.
Related concepts
- JSONkind of · JSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
- @> operatorused by · The PostgreSQL JSON @> operator tests whether one JSON value contains another JSON value.
- xmlalternative to · XML (Extensible Markup Language) is a text-based markup language for representing structured information using elements, attributes, and nested relationships.
- GIN indexuses · A GIN index is a PostgreSQL generalized inverted index that maps components of composite values to rows containing them.
- GiST indexuses · A GiST index is a PostgreSQL extensible index structure that supports generalized searches over diverse data types and predicates.
- PostgreSQLused by · PostgreSQL is an open-source object-relational database management system that stores and queries data using SQL and supports extensible data types and operations.
Questions about jsonb
What is jsonb?
JSONB is PostgreSQL's binary JSON data type, storing JSON values in decomposed form for efficient processing and indexing.
Which Manning books explain jsonb?
Just Use Postgres!, PostgreSQL Mistakes and How to Avoid Them and Designing AI Systems.
What should I know before learning jsonb?
Manning books that teach jsonb usually introduce GIN index first.
What is the difference between jsonb and xml?
JSONB is PostgreSQL's binary JSON data type, storing JSON values in decomposed form for efficient processing and indexing. XML (Extensible Markup Language) is a text-based markup language for representing structured information using elements, attributes, and nested relationships.
What is jsonb a kind of?
Jsonb is a kind of JSON. JSON is a language-independent text-based data-interchange format that represents structured values using objects, arrays, strings, numbers, booleans, and null.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


