Schema Design & Migrations
Turning a product feature into tables, and changing those tables later without taking the product down.
6 topics
Designing a Schema for a Feature
A repeatable path from a product description to tables, keys and indexes — the exercise a design round actually runs.
core25 minPrimary Keys & Identifiers
Sequential integer, UUIDv4 or UUIDv7 — the choice affects index locality, enumeration risk, and whether clients can generate ids.
core20 minModelling Time & Timezones
Store instants in UTC with timestamptz, store civil time as what the user meant, and never store an offset as a timezone.
core20 minSoft Deletes & Audit History
Marking a row deleted is a product decision with a query-correctness cost, and audit history is a different problem people solve with the same column.
core20 minZero-Downtime Migrations
The expand–migrate–contract sequence that lets a schema change ship while old and new code are both running.
core25 minMulti-Tenancy Data Models
Shared tables, schema per tenant, or database per tenant — and why shared-with-a-tenant-column is the default that scales furthest.
core20 min