Skip navigation

JSON in PostgreSQL - evil data type or just needs to be tamed?

Boriss Mejias

Boriss Mejias Boriss Mejias

(Livestream 1)

You heard that PostgreSQL also supports the JSON data type, and you wanted to enjoy the dynamism of schema freedom mixed with the benefits of a relational database. You wanted a flexible data type combined with columns with strong types, with relationships between tables, and with constraints to guarantee data integrity. But now that you have integrated JSON deep in your schema design, you start observing odd behaviors, unpredictable performance, and unused indexes. You start to wonder if you haven’t introduced an evil data type disguised as a friendly and flexible object. Maybe there are things you could do in Postgres to make things run faster. Are some indexes better than others? What about table partitioning? And what about TOAST tables? Do they play a role accessing the data stored in JSON? Or …

maybe the B in JSONB stands for Beast? Can you tame the JSONB objects?

In this talk we will review schema-design decisions when using JSON/JSONB in PostgreSQL, with some tips and tricks, based on experience working with real case scenarios. We will work through a case study to create a pragmatic view of working with JSON/JSONB in PostgreSQL.

talk bubbles
Join the conversation

Use the hashtag #PosetteConf