Modelling: When JSONB Beats Normalisation
Decide between a JSONB column and a separate table — flexible attributes vs strict schemas.
The Choice
For each piece of data you might store: column or JSONB key? The answer drives schema design, query performance, and maintainability.
When Columns Win
Use real columns when data is:
- Known and stable
- Queried frequently with indexes
- Validated by CHECK / FK constraints
- Reported on or joined
All lessons in this course
- JSONB vs JSON: When to Use Each
- Path Operators: -> ->> @>
- Indexing JSONB with GIN
- Modelling: When JSONB Beats Normalisation