JSONB ist PostgreSQLs binärer JSON-Typ — er speichert JSON-Daten in einem effizienten, abfragbaren und indexierbaren Format. Er ermöglicht dir, flexible, halbstrukturierte Daten in einer relationalen Datenbank zu speichern und kombiniert relationale Integrität mit NoSQL-ähnlicher Flexibilität. Es ist eine der mächtigsten Funktionen von Postgres.
JSONB vs JSON
JSON → stores the exact text (preserves whitespace/key order/duplicates), parsed each query
JSONB → stores a DECOMPOSED BINARY format → slightly slower to write, but MUCH faster
to query, and supports INDEXING and rich operators
→ Use JSONB in almost all cases (JSON only if you need exact text preservation).
