Databases
Choose a data model from access patterns, invariants, consistency needs, and operational constraints—not fashion.
Core ideas
- Schema and constraints make invalid states harder to represent.
- Indexes exchange write/storage cost for faster reads.
- Transactions protect invariants across related operations.
- Isolation levels control which concurrent anomalies are possible.
- Replication improves availability/read scale but introduces lag and failover complexity.
- Backups matter only when restore is tested.
Query review
Check cardinality, query plan, indexes, row/field selection, round trips, locks, pagination, and representative production-scale data.
Migration safety
Prefer backward-compatible expand/migrate/contract stages. Plan long transactions, locking, rollback, and old application versions during rollout.