A compact checklist for schema design, relationships, indexes, migrations, and production-safe database habits.
A good database schema makes the application simpler. If the relationships are clear, the UI and API usually become easier to reason about.
Start with the real entities: users, notes, comments, orders, products, sessions, or whatever the system actually manages. Then define which records own other records and what should happen when something is deleted.
Indexes matter once the data grows. If a page filters by slug, userId, status, or createdAt, those fields are candidates for indexes. Performance problems often come from missing indexes, not from React or CSS.
Migrations should be treated like application code. Review them, run them in a safe order, and avoid destructive changes without backups. The database is the memory of the product.
Nested replies, so conversations can branch naturally like Reddit threads.