fundamentals
Reusable database fundamentals: substrate choice, normalization, isolation, locking, migrations, pooling, backups, least privilege. Use for any database decision before engine specifics.
SKILL.mdskills/databases/fundamentals/SKILL.md
GitHubfundamentals
Choose the substrate by access pattern, then apply the same operational discipline everywhere.
Activate when
- Picking relational vs document vs KV/cache, designing schemas, or reviewing any data-layer change.
Do NOT activate for
- Engine specifics (see postgres-operations, mysql, redis, mongodb); credential handling (see database-security).
Procedure
- Substrate: relational when relationships are queryable and schema known; document when access is aggregate-shaped; KV/cache when access is key→value with no joins. Name the access pattern before choosing.
- Model: identity, ownership, lifecycle, invariants; normalization by default, denormalization only for measured reads.
- Correctness: transactions with the isolation level the workflow needs; locking chosen deliberately (optimistic vs pessimistic); migrations expand→migrate→contract with down-paths.
- Operations: connection pooling sized to workload, statement timeouts, backups with restore drills, replication lag awareness.
- Security: least-privilege roles, read-only agents, destructive-query guards (see database-security).
- Verify: migration up+down on scratch, slow-query log reviewed, concurrent-worker test where locking is used.
References
- Engine leaves:
../postgres-operations/,../mysql/,../redis/,../mongodb/;../database-security/.