Syntic

Skills may execute instructions and code that could affect your environment. Marketplace scans reduce risk but do not guarantee safety. Always review files, run your own security checks, and use at your own risk.

DevOps & PlatformFree Safe

Database Admin

Security Scan Summary

Status: Safe

Source: Syntic Skills registry

Automated security scan completed with no high-risk patterns detected. Manual review is still required.

About This Skill

Use when designing database schemas, optimizing queries, managing replication, backups, and high-load operations

Downloadable SKILL.md

Download SKILL.md and place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review contents, and run in a controlled environment first. Acknowledge the risk notice above to enable the download.

SKILL.md
---
name: Database Admin
description: Use when designing database schemas, optimizing queries, managing replication, backups, and high-load operations
category: DevOps & Platform
version: 1.0.0
tools: []
---

# Database Admin

Design schemas, optimize queries, ensure data integrity under load for PostgreSQL, MySQL, MongoDB. Think about access patterns before writing schemas.

## Schema Design

- Design around query patterns, not object hierarchies: "how will this data be read?" before "how should it be stored?"
- Normalize to 3NF by default; denormalize deliberately when read performance requires it, documenting tradeoffs
- Every table has primary key: UUIDs (uuid_generate_v4()) for distributed systems, auto-increment for single-database
- Add created_at/updated_at timestamps everywhere, database-level defaults and triggers
- Foreign key constraints enforce referential integrity; disable only if benchmarks prove bottleneck

## PostgreSQL Optimization

- Use EXPLAIN ANALYZE to understand execution plans, look for sequential scans on large tables
- Index columns in WHERE, JOIN, ORDER BY, GROUP BY clauses
- Partial indexes for filtered queries: CREATE INDEX idx_active_users ON users(email) WHERE active = true
- Composite indexes with most selective column first
- pg_stat_statements identifies slow queries; optimize top 10 by total execution time
- Set work_mem appropriately for sorts, monitor with pg_stat_activity
- PgBouncer connection pooling in transaction mode for high-concurrency

## MySQL Optimization

- InnoDB engine exclusively; MyISAM has no place in modern deployments
- EXPLAIN with FORMAT=TREE or FORMAT=JSON for detailed analysis
- InnoDB buffer pool tuned to fit working set in memory (70-80% available RAM)
- Covering indexes satisfy queries entirely from index
- Avoid SELECT *; specify only needed columns
- pt-query-digest from Percona Toolkit analyzes slow query logs

## MongoDB Optimization

- Embed data accessed together, reference independently accessed documents
- Compound indexes matching query predicates and sort orders; index order matters
- Aggregation pipeline for complex transformations, avoid $lookup in hot paths
- readPreference=secondaryPreferred for analytics, offloading primary
- explain("executionStats") verifies index usage, document examination counts
- Shard collections only when single replica set cannot handle write throughput

## Migrations, Replication, Backups

- Migration tools track applied migrations: Flyway, Alembic, Prisma Migrate, golang-migrate
- Migrations reversible: write both up/down scripts
- Never modify applied migrations; create new ones instead
- Expand-contract pattern for zero-downtime: add column, backfill, switch reads, drop old
- Streaming replication (PostgreSQL) or GTID-based (MySQL) for read replicas
- Monitor replication lag; alert when >5-10s baseline
- Automate daily full backups + continuous WAL/binlog archiving
- Store backups in separate region; test restoration monthly
- Retain backups per regulatory requirements (daily 30d, weekly 1y minimum)

## Security

- Separate database users per app with minimum required privileges
- Enable SSL/TLS for all connections; reject unencrypted
- Encrypt data at rest using TDE or filesystem encryption
- Audit access with log analysis; track DDL changes, privilege grants
- Parameterized queries exclusively; never construct SQL from concatenation

Bundle Download

Includes SKILL.md and bundled support files where provided. Risk acknowledgement is required.

Install Targets

Syntic App

  1. 1. Create a dedicated folder for this skill in your local skills library.
  2. 2. Place SKILL.md into that folder.
  3. 3. Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1. Save SKILL.md in your local Syntic Code skills directory.
  2. 2. Keep related files in the same skill folder.
  3. 3. Run in a safe environment and validate outputs.

Source

https://github.com/rohitg00/awesome-claude-code-toolkit/blob/main/agents/infrastructure/database-admin.md

Open Source Link
DevOps & Platform

Related Skills