← ClaudeAtlas

database-engineeringlisted

Senior database engineering — schema design, constraints, indexing, query optimisation, N+1 elimination, transactions and isolation, migrations, multi-tenancy and row-level security, backups, point-in-time recovery and restore drills, retention and deletion. Use when designing or changing a schema, writing or reviewing migrations, when the user says "slow query", "database design", "add an index", "N+1", "my database is slow", "migration", "data model", "schema", "backup", "restore", "postgres", "mysql", "mongodb", "ORM", "deadlock", "connection pool" or "row level security"; and as a mandatory pass in any project audit. By Devleck.
Kin9Zeus/senior-engineer-skills · ★ 3 · API & Backend · score 77
Install: claude install-skill Kin9Zeus/senior-engineer-skills
# Database Engineering The schema outlives the code, the framework, and usually the company. Application bugs are fixed with a deploy; data-model mistakes are fixed with a migration project, and data loss is fixed with nothing at all. --- ## The five questions that open every review 1. **What are the constraints?** Not in the ORM — in the database. `SELECT` against the catalogue, not the model file. 2. **Which foreign keys are unindexed?** Almost always the top performance finding, and it never shows up in development. 3. **What does the hottest query actually do?** `EXPLAIN ANALYZE`, not intuition. 4. **When was a backup last restored?** Not "do backups exist" — restored. 5. **What happens to a row when the user asks to be deleted?** If nobody can answer, that is a compliance finding as well as a design one. --- ## Schema design **Constraints belong in the database.** The ORM is not the only writer — a migration script, an admin tool, an analytics job, a psql session or a future service will write directly. A rule enforced only in application code is a rule that will be broken. - Primary key on every table. - Foreign keys with an **explicit** `ON DELETE` — `CASCADE`, `RESTRICT` or `SET NULL` chosen per relationship. Copying `CASCADE` everywhere is how a user deletion silently removes audit records. - `NOT NULL` wherever the business says required. Nullable-by-default columns push the check into every consumer, forever. - `UNIQUE` on what is genuinely u