JSONB PostgreSQL ਦੀ ਬਾਈਨਰੀ JSON ਕਿਸਮ ਹੈ — ਇਹ JSON ਡੇਟਾ ਨੂੰ ਇੱਕ ਮਾਮੂਲੀ, ਪ੍ਰਸ਼ਨਯੋਗ, ਅਤੇ ਇੰਡੈਕਸ ਕਰਨ ਯੋਗ ਫਾਰਮੈਟ ਵਿੱਚ ਸਟੋਰ ਕਰਦਾ ਹੈ। ਇਹ ਤੁਹਾਨੂੰ ਲਚਕਦਾਰ, ਅਰਧ-ਸੰਰਚਿਤ ਡੇਟਾ ਨੂੰ ਸਬੰਧਿਤ ਡੇਟਾਬੇਸ ਵਿੱਚ ਸਟੋਰ ਕਰਨ ਦਿੰਦਾ ਹੈ, ਸਬੰਧਿਤ ਸੂਚੀ ਨੂੰ NoSQL-ਵਰਗੀ ਲਚਕ ਦੇ ਨਾਲ ਜੋੜਦਾ ਹੈ। ਇਹ Postgres ਦੀਆਂ ਸਭ ਤੋਂ ਸ਼ਕਤੀਸ਼ਾਲੀ ਵਿਸ਼ੇਸ਼ਤਾਵਾਂ ਵਿੱਚੋਂ ਇੱਕ ਹੈ।
JSONB ਬਨਾਮ 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).
