Choosing the right database

Stage 2 · Lesson 4 of 6

JSON columns for the flexible parts

Relational databases: the sensible default

Many apps have mostly fixed data plus a flexible corner: product attributes that differ by category, user settings, raw webhook payloads. You do not need a second database for that. has a jsonb type that stores JSON in a binary form you can query with operators such as ->> and @> and index with a .

MySQL has a JSON type and can index values through . Keep the fields you filter, join or sort on often as real columns, and put the varying extras in a JSON column. You get flexible data and in one place.

Common trapthe opposite extreme: one table with an id and a giant JSON blob, which throws away and makes every query harder.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

  • CoursePaid
    Grokking Relational Database Design and Modeling

    Design Gurus · Intermediate · $98 one-time

    Data modelling, ER diagrams, keys and normalisation for the relational default, with worked designs

  • GuideFree
    PostgreSQL Tutorial

    PostgreSQL Global Development Group · Beginner

    The short official tutorial: create a database, tables and your first queries in an evening

Practise

  • Run SQL on PostgreSQL, MySQL or SQLite in the browser and compare how each handles JSON

  • Free interactive lessons if your SQL needs warming up before the hands-on task

Keep handy

Also worth your time

Mark this stage as not done?