0Pricing
SQL Academy · Lesson

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

  1. JSONB vs JSON: When to Use Each
  2. Path Operators: -> ->> @>
  3. Indexing JSONB with GIN
  4. Modelling: When JSONB Beats Normalisation
← Back to SQL Academy