Opscraft
Databases

Database operations

New6 lessons · 22 min · 3 tests ·

Databases hold the one thing you can't redeploy: the data. DevOps and platform engineers are expected to run them safely even without being database administrators: backups that actually restore, replication and failover that apps survive, connection and performance problems, schema changes without downtime, and upgrades. Interviewers probe this with "your database is down", "someone dropped a table" and "how do you upgrade PostgreSQL with no downtime?". This topic focuses on PostgreSQL and MySQL on AWS (RDS and Aurora), with ideas that carry over anywhere.

Stage 3 · Production platforms

Know these first

After this topic you can

  • Design backups with point-in-time recovery and prove they restore
  • Choose between Multi-AZ, replicas and Aurora and make apps survive failover
  • Run schema changes and major upgrades without downtime

Lessons

  1. 1How databases keep data safe 3 min read
    • What operations owns
    • The write-ahead log
    • RPO and RTO
  2. 2Backups and recovery 4 min read
    • Kinds of backup
    • Backups on RDS and Aurora
    • Restores are the real test
  3. 3Replication and high availability 4 min read
    • Synchronous and asynchronous replication
    • RDS and Aurora options
    • Surviving a failover
  4. 4Performance and capacity 3 min read
    • Connections
    • Slow queries and locks
    • Storage, vacuum and growth
  5. 5Changes and upgrades 4 min read
    • Schema migrations without downtime
    • Engine upgrades
    • Security
  6. 6Interview questions and model answers 4 min read
    • "Someone ran DELETE without a WHERE clause on production an hour ago. What do you do?"
    • "RPO vs RTO?"
    • "Multi-AZ vs read replicas?"
    • "How does your application survive a database failover?"
    • "The app gets 'too many connections' after we scaled from 10 to 50 pods. Why and what do you do?"
    • "How do you add a column and an index to a 500 GB table with no downtime?"
    • "How would you upgrade PostgreSQL 15 to 17 on RDS with minimal downtime?"
    • "How do you know your backups work?"