Skip to content
RED SAGSkills
mediumDatabase Administrator interview question

Which metrics and alerts would you set up for a production PostgreSQL or MySQL database?

What the interviewer wants to hear

  • Availability and replication health, including lag
  • Resource use: CPU, memory, disk space and growth, I/O latency
  • Connections versus limits, and long or blocked transactions
  • Query performance from pg_stat_statements or performance_schema
  • Backup and archive success, vacuum and wraparound age for PostgreSQL
  • Alerts on symptoms with thresholds and runbooks, not on every metric

Model answer

I would collect metrics with exporters into Prometheus and build Grafana dashboards, and keep alerts focused on things that need action. Critical alerts: database down, replica disconnected or lag above the RPO, disk predicted to fill within a few hours, backups or WAL archiving failing, and for PostgreSQL transaction ID age approaching wraparound. Warning alerts: connections above about 80 percent of max_connections, long-running or idle-in-transaction sessions, lock waits, rising deadlocks and high I/O latency. For performance I track query latency and throughput from pg_stat_statements or performance_schema, cache hit ratio, temp file usage and checkpoints. Each alert links to a short runbook. I also review trends weekly for capacity planning, because slow growth in data size or load is easier to fix early.

Can you answer it under time pressure?

Take a timed medium round and get scored on every answer.

Start mock interview

More medium Database Administrator questions