04. Databases
Where the data lives. Most modern web apps store users, content, and state in a database. This section covers what databases are, the main families (SQL vs NoSQL), the specific tools I use (Postgres via Supabase), and the patterns and traps that come with each.
Entries
| # | Entry | Status | One-line description |
|---|---|---|---|
| 1 | What is a database? | π© COMPLETE | A persistent, organized store for your appβs data |
| 2 | SQL vs NoSQL | π© COMPLETE | The two main database philosophies and when each fits |
| 3 | SQL β the language | π© COMPLETE | SELECT/INSERT/UPDATE/DELETE and the rest of the basics |
| 4 | Postgres | π© COMPLETE π¦ LIVING | The worldβs most powerful open-source relational database |
| 5 | Supabase | π© COMPLETE π¦ LIVING | Postgres + auth + storage + APIs, packaged as a service |
| 6 | Schema design | π© COMPLETE | Tables, columns, types β designing them so you donβt regret it |
| 7 | Migrations | π© COMPLETE | Versioned, replayable changes to your database structure |
| 8 | Row-Level Security (RLS) | π© COMPLETE | Per-row access control β Postgres/Supabaseβs killer security feature |
| 9 | Indexes & performance | π© COMPLETE | The single biggest lever for speeding up queries |
| 10 | Joins & relationships | π© COMPLETE | How tables connect to each other β one-to-many, many-to-many, etc. |
| 11 | Transactions & ACID | π© COMPLETE | All-or-nothing operations β why your bank loves them |
Suggested reading order
1 β 2 β 3 β 4 β 5 β 6 β 8 β 7 β 10 β 9 β 11. If you only read three, read 1, 5, and 8 β Supabase + RLS is the day-to-day reality.
See also
- 03. Backend β what usually talks to the database
- 07. Security & auth β auth and RLS are deeply intertwined
- Gotchas β Supabase